本文整理汇总了PHP中get_component函数的典型用法代码示例。如果您正苦于以下问题:PHP get_component函数的具体用法?PHP get_component怎么用?PHP get_component使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_component函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
if ($this->get_cached_widget($args)) {
return;
}
if (!empty($_GET['selected_package'])) {
return;
}
extract($args);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$icon = isset($instance['icon']) ? $instance['icon'] : null;
if ($icon) {
$before_title = sprintf($before_title, 'ion-' . $icon);
}
ob_start();
global $post, $product;
$products = $this->get_bookable_products($post->ID);
$job_id = $post->ID;
if (!$products) {
return;
}
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
$booking_calendar = $this->get_booking_calendar(reset($products));
get_component('element', 'booking-product', compact('products', 'booking_calendar'));
echo $after_widget;
$content = ob_get_clean();
echo apply_filters($this->widget_id, $content);
$this->cache_widget($args, $content);
}
开发者ID:darbymanning,项目名称:Family-Church,代码行数:41,代码来源:WidgetBookings.php
示例2: render
/**
* Méthode permettant d'afficher l'arbre à partir de celui passé en paramètre.
*
* @param ITree $tree
* @param array $options
* @param $key
*
* @return mixed|string
*/
public function render(ITree $tree, array $options, $key)
{
$this->defaults($tree, $tree->getRoot());
if ($key != null && !isset($options["baseId"])) {
$options["id"] = $this->options["id"] . "_" . $key;
$options["baseId"] = $this->options["id"];
} elseif ($key != null && isset($options["baseId"])) {
$options["id"] = $options["baseId"] . "_" . $key;
}
if ($key != null && isset($options["selected"])) {
$options["selected"] = isset($options["selected"][$key]) ? $options["selected"][$key] : "";
}
$options = array_merge($this->options, $options);
$build = function ($tree) use(&$build, &$options, $key) {
$output = is_string($options['rootOpen']) ? $options['rootOpen'] : $options['rootOpen']($tree);
$nodes = $tree instanceof ITreeViewerItem && $tree->isRoot() ? array($tree) : $tree;
/** @var ITreeViewerItem $node */
foreach ($nodes as $node) {
$output .= is_string($options['childOpen']) ? $options['childOpen'] : $options['childOpen']($node, $node->getType(), $key);
$output .= $options['nodeDecorator']($node);
if (count($node->getChildren()) > 0) {
$output .= $build($node->getChildren());
}
$output .= is_string($options['childClose']) ? $options['childClose'] : $options['childClose']($node);
}
return $output . (is_string($options['rootClose']) ? $options['rootClose'] : $options['rootClose']($tree));
};
return html_entity_decode(sfOutputEscaper::unescape(get_component("eitreeviewer", "displaySelectMode", array("root" => $tree, "html" => $build($tree->getRoot()), "options" => $options, "key" => $key, "tree" => $this))), ENT_QUOTES, "UTF-8");
}
开发者ID:lendji4000,项目名称:compose,代码行数:38,代码来源:ModeSelectTreeStrategy.php
示例3: shortcode
public function shortcode($atts = array(), $content = '')
{
$atts = $this->logic(shortcode_atts($this->get_default_atts(), $atts, $this->base));
if ($content) {
$atts['content'] = do_shortcode($content);
}
return get_component('Shortcode', $this->base, $atts, false);
}
开发者ID:darbymanning,项目名称:Family-Church,代码行数:8,代码来源:Shortcode.php
示例4: upload_field_upload_markup
public function upload_field_upload_markup($markup, $file, $form_id, $id)
{
$file_path = GFFormsModel::get_file_upload_path($form_id, $file['uploaded_filename']);
$url = explode('/', $file_path['url']);
array_pop($url);
array_push($url, $file['uploaded_filename']);
$file['url'] = implode('/', $url);
return get_component('twig', 'uploaded-file', compact('file', 'form_id', 'id'), false);
}
开发者ID:darbymanning,项目名称:Family-Church,代码行数:9,代码来源:FormController.php
示例5: sendAdminNotification
public static function sendAdminNotification($booking)
{
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
$mailer = sfContext::getInstance()->getMailer();
$body = '<html><body>' . get_component('Payment', 'adminNotificationEmail', array('booking' => $booking)) . '</body></html>';
$message = $mailer->compose(array('[email protected]' => 'lkm.ee'), sfConfig::get('app_admin_email'), '');
$message->setBody($body, 'text/html');
$mailer->send($message);
}
开发者ID:sensorsix,项目名称:app,代码行数:9,代码来源:PaymentMailer.php
示例6: render
protected function render($view, $vars = array(), $echo = true)
{
$path = str_replace('Controller', '', implode('/', explode('\\', str_replace('App\\Controllers\\', '', get_called_class()))));
$html = get_component($path, $view, $vars, $echo);
if ($echo) {
echo $html;
} else {
return $html;
}
}
开发者ID:darbymanning,项目名称:Family-Church,代码行数:10,代码来源:Controller.php
示例7: fossa_sidebar2_ads
function fossa_sidebar2_ads()
{
if (component_exists('sidebar2-ads')) {
echo "<div class=\"sidebarads\">";
get_component('sidebar2-ads');
echo "</div><div class=\"clear\"></div>";
} else {
return;
}
}
开发者ID:kjodle,项目名称:fossa,代码行数:10,代码来源:functions.php
示例8: display_instagramfeed
public function display_instagramfeed()
{
$instagram_uid = "1186117710";
$access_token = "19039620.87d5630.e4a8f758e4ad4901b195c97fac5c4caf";
$photo_count = 12;
$json_link = "https://api.instagram.com/v1/users/{$instagram_uid}/media/recent/?";
$json_link .= "access_token={$access_token}&count={$photo_count}";
$json = file_get_contents($json_link);
$obj = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
get_component('elements', 'instagram-feed', compact('obj'));
}
开发者ID:darbymanning,项目名称:Family-Church,代码行数:11,代码来源:IndexController.php
示例9: depp_voter
/**
* Return the HTML code for an unordered list showing opinions that can be voted
* If the user has already voted, then a message appears
*
* @param BaseObject $object Propel object instance to vote
* @param string $domid unique css identifier for the block (div) containing the voter tool
* @param string $message a message string to be displayed in the voting-message block
* @param array $options Array of HTML options to apply on the HTML list
* @return string
**/
function depp_voter($object, $domid = 'depp-voter-block', $message = '', $options = array())
{
if (is_null($object)) {
sfLogger::getInstance()->debug('A NULL object cannot be voted');
return '';
}
$user_id = deppPropelActAsVotableBehaviorToolkit::getUserId();
// anonymous votes
if ((is_null($user_id) || $user_id == '') && !$object->allowsAnonymousVoting()) {
return __('Anonymous voting is not allowed') . ", " . __('please') . " " . link_to('login', '/login');
}
try {
$voting_range = $object->getVotingRange();
$options = _parse_attributes($options);
if (!isset($options['id'])) {
$options = array_merge($options, array('id' => 'voting-items'));
}
if ($object instanceof sfOutputEscaperObjectDecorator) {
$object_class = get_class($object->getRawValue());
} else {
$object_class = get_class($object);
}
$object_id = $object->getReferenceKey();
$token = deppPropelActAsVotableBehaviorToolkit::addTokenToSession($object_class, $object_id);
// already voted
if ($object->hasBeenVotedByUser($user_id)) {
$message .= " " . link_to_remote(__('Take your vote back'), array('url' => sprintf('deppVoting/unvote?domid=%s&token=%s', $domid, $token), 'update' => $domid, 'script' => true, 'complete' => visual_effect('appear', $domid) . visual_effect('highlight', $domid)));
}
$list_content = '';
for ($i = -1 * $voting_range; $i <= $voting_range; $i++) {
if ($i == 0 && !$object->allowsNeutralPosition()) {
continue;
}
$text = sprintf("[%d]", $i);
$label = sprintf(__('Vote %d!'), $i);
if ($object->hasBeenVotedByUser($user_id) && $object->getUserVoting($user_id) == $i) {
$list_content .= content_tag('li', $text);
} else {
$list_content .= ' <li>' . link_to_remote($text, array('url' => sprintf('deppVoting/vote?domid=%s&token=%s&voting=%d', $domid, $token, $i), 'update' => $domid, 'script' => true, 'complete' => visual_effect('appear', $domid) . visual_effect('highlight', $domid)), array('title' => $label)) . '</li>';
}
}
$results = get_component('deppVoting', 'votingDetails', array('object' => $object));
return content_tag('ul', $list_content, $options) . content_tag('div', $message, array('id' => 'voting-message')) . content_tag('div', $results, array('id' => 'voting-results'));
} catch (Exception $e) {
sfLogger::getInstance()->err('Exception catched from sf_rater helper: ' . $e->getMessage());
}
}
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:57,代码来源:deppVotingHelper.php
示例10: get_nested_set_manager
function get_nested_set_manager($model, $field, $root = 0)
{
if (!sfConfig::has('app_sfJqueryTree_withContextMenu')) {
sfConfig::set('app_sfJqueryTree_withContextMenu', true);
}
sfContext::getInstance()->getResponse()->addStylesheet('/sfJqueryTreeDoctrineManagerPlugin/jsTree/themes/default/style.css');
sfContext::getInstance()->getResponse()->addStylesheet('/sfJqueryTreeDoctrineManagerPlugin/css/screen.css');
// by vit
// sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/jquery.js');
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/jquery.cookie.js');
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/jquery.tree.min.js');
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/plugins/jquery.tree.cookie.js');
if (sfConfig::get('app_sfJqueryTree_withContextMenu')) {
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/plugins/jquery.tree.contextmenu.js');
}
return get_component('sfJqueryTreeDoctrineManager', 'manager', array('model' => $model, 'field' => $field, 'root' => $root));
}
开发者ID:228vit,项目名称:sftree,代码行数:17,代码来源:sfJqueryTreeDoctrineHelper.php
示例11: getSlotValue
public function getSlotValue($slot)
{
sfLoader::loadHelpers(array('Partial'));
$components = sfYaml::load($slot->getValue());
$res = '';
foreach ($components as $name => $params) {
if (!isset($params['component']) && !isset($params['partial'])) {
return sprintf('<strong>Error</strong>: The value of slot %s in incorrect. Component %s has no \'component\' or \'partial\' key.', $slot->getName(), $name);
}
if (isset($params['component'])) {
// component
list($module, $action) = split('/', $params['component']);
unset($params['component']);
$res .= get_component($module, $action, $params);
} else {
// partial
$res .= get_partial($params['partial'], $params);
unset($params['partial']);
}
}
return $res;
}
开发者ID:net7,项目名称:Talia-CMS,代码行数:22,代码来源:sfSimpleCMSSlotModular.class.php
示例12: dynpages_replace_match
function dynpages_replace_match($match)
{
global $args;
$replacement = '';
if ($match[1] && (!isset($match[4]) || !$match[4])) {
$replacement .= $match[1];
}
if (isset($args)) {
$saved_args = $args;
}
$args = array();
$paramstr = isset($match[3]) ? html_entity_decode(trim($match[3]), ENT_QUOTES, 'UTF-8') : '';
while ($paramstr && preg_match('/^([^"\', ]*|"[^"]*"|\'[^\']*\')(\\s+|\\s*,\\s*|$)/', $paramstr, $pmatch)) {
$value = trim($pmatch[1]);
if (substr($value, 0, 1) == '"' || substr($value, 0, 1) == "'") {
$value = substr($value, 1, strlen($value) - 2);
}
$args[] = $value;
$paramstr = substr($paramstr, strlen($pmatch[0]));
}
ob_start();
if (function_exists('get_i18n_component')) {
get_i18n_component($match[2]);
} else {
get_component($match[2]);
}
$replacement .= ob_get_contents();
ob_end_clean();
if (isset($saved_args)) {
$args = $saved_args;
} else {
unset($args);
}
if (!$match[1] && isset($match[4]) && $match[4]) {
$replacement .= $match[4];
}
return $replacement;
}
开发者ID:Vin985,项目名称:clqweb,代码行数:38,代码来源:dynpages.php
示例13: execute
/**
* Executes the filter chain, returning the response content with an additional admin toolbar.
*
* @param sfFilterChain $filterChain
*/
public function execute(sfFilterChain $filterChain)
{
$filterChain->execute();
$user = $this->getContext()->getUser();
$sf_format = $this->getContext()->getRequest()->getParameter('sf_format');
if ($sf_format !== '' && !is_null($sf_format) || !$user->isAuthenticated() || !$user->hasPermission(sfConfig::get('app_rt_admin_menu_credential', 'show_admin_menu'))) {
return;
}
$response = $this->getContext()->getResponse();
// Enable admin tools...
$response->setContent(str_replace(array('<!--RTAS', 'RTAS-->'), '', $response->getContent()));
if (function_exists('use_helper')) {
$css = '<link rel="stylesheet" type="text/css" media="screen" href="/rtCorePlugin/css/admin-toolbar.css" />';
$js = '<script type="text/javascript" src="/rtCorePlugin/vendor/jquery/js/jquery.min.js"></script>';
use_helper('Partial', 'I18N');
$toolbar = get_component('rtAdmin', 'menu');
$response->setContent(str_ireplace('<!--rt-admin-holder-->', $toolbar, $response->getContent()));
$response->setContent(str_ireplace('</head>', $css . '</head>', $response->getContent()));
if (!preg_match("/jquery/i", $response->getContent())) {
$response->setContent(str_ireplace('</head>', $js . '</head>', $response->getContent()));
}
}
}
开发者ID:pierswarmers,项目名称:rtCorePlugin,代码行数:28,代码来源:rtAdminToolbarFilter.class.php
示例14: include_component
/**
* Evaluates and echoes a component.
* For a variable to be accessible to the component and its partial,
* it has to be passed in the third argument.
*
* <b>Example:</b>
* <code>
* include_component('mymodule', 'mypartial', array('myvar' => 12345));
* </code>
*
* @param string module name
* @param string component name
* @param array variables to be made accessible to the component
* @return void
* @see get_component, include_partial, include_component_slot
*/
function include_component($moduleName, $componentName, $vars = array())
{
echo get_component($moduleName, $componentName, $vars);
}
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:20,代码来源:PartialHelper.php
示例15: getSymfonyResource
/**
* Get a symfony resource (partial or component)
*
* This basically looks first for a component defined by the given module
* and action. If one doesn't exist, it then looks for a partial matching
* the module and action pair.
*
* @param string $module
* @param string $action
* @param array $variables
* @return string $html
*/
public static function getSymfonyResource($module, $action = null, $variables = array())
{
if (strpos($module, '/')) {
$variables = (array) $action;
$e = explode('/', $module);
list($module, $action) = $e;
}
$context = sfContext::getInstance();
$context->getConfiguration()->loadHelpers('Partial');
$controller = $context->getController();
if ($controller->componentExists($module, $action)) {
return get_component($module, $action, $variables);
} else {
return get_partial($module . '/' . $action, $variables);
}
throw new sfException('Could not find component or partial for the module "' . $module . '" and action "' . $action . '"');
}
开发者ID:sympal,项目名称:sympal,代码行数:29,代码来源:sfSympalToolkit.class.php
示例16: get_component
<?php
echo get_component('specimenwidget', 'loan', array('table' => 'specimens', 'eid' => $eid, 'view' => true));
开发者ID:naturalsciences,项目名称:Darwin,代码行数:3,代码来源:_loan.php
示例17: get_component_slot
<div class="column sidebar" id="sidebar-first">
<div class="section">
<?php
echo get_component_slot('sidebar');
?>
<?php
echo get_component('menu', 'browseMenu');
?>
</div> <!-- /.section -->
</div> <!-- /.column.sidebar#sidebar-first -->
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:13,代码来源:_sidebar.php
示例18: get_site_url
<div>
<h1><a href="<?php
get_site_url();
?>
" alt="<?php
get_site_name();
?>
" title="<?php
get_site_name();
?>
"><?php
get_site_name();
?>
</a></h1>
<h2><?php
if (component_exists('sous-titre')) {
get_component('sous-titre');
} else {
echo "";
}
?>
</h2>
</div>
<div>
<img src="<?php
get_site_url();
?>
/data/uploads/illustrations/portrait-2016-1.jpg" class="ombre-bouton" alt="portrait Anne Jaussiomme" title="Anne Jaussiomme, Coach">
</div>
</div>
</header><!-- header .branding -->
开发者ID:Daminoweb,项目名称:CoachingJauss2,代码行数:31,代码来源:header.inc.php
示例19: foreach
foreach ($representations as $usageId => $representation) {
?>
<fieldset class="collapsible">
<legend><?php
echo __('%1% representation', array('%1%' => QubitTerm::getById($usageId)));
?>
</legend>
<?php
if (isset($representation)) {
?>
<?php
echo get_component('digitalobject', 'editRepresentation', array('resource' => $resource, 'representation' => $representation));
?>
<?php
$rightComponent = "rightEditComponent_{$usageId}";
?>
<?php
echo get_partial('right/edit', ${$rightComponent}->getVarHolder()->getAll() + array('tableId' => $usageId));
?>
<?php
} else {
?>
<?php
echo $form["repFile_{$usageId}"]->label(__('Select a digital object to upload'))->renderRow();
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:31,代码来源:editSuccess.php
示例20: slot
<?php
slot('subject');
?>
<h1><?php
echo __('Dimensions');
?>
</h1>
<?php
end_slot();
?>
<?php
get_component('bottomArticlesWidget', 'render');
?>
<?php
slot('content');
?>
<div id="roofcarousel" class="roofcarousel">
<div class="boxinrighttop">
<ul>
<?php
foreach ($data as $index => $info) {
?>
<li>
<div class="roofimg">
<div class="roofid" style="display:none"><?php
echo $index;
?>
开发者ID:vcgato29,项目名称:poff,代码行数:31,代码来源:dimensionsSuccess.php
注:本文中的get_component函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论