当前位置: 首页>>代码示例>>PHP>>正文


PHP Component::render方法代码示例

本文整理汇总了PHP中Component::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::render方法的具体用法?PHP Component::render怎么用?PHP Component::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Component的用法示例。


在下文中一共展示了Component::render方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderComponent

 private function renderComponent(Component $viewComp)
 {
     if (isset($_GET["ajax"])) {
         return StringUtil::getJson("body", $viewComp->renderBodyChildren());
     }
     $view = $viewComp->render();
     if (isset($_GET["file"])) {
         $view .= $this->jsRewriteParent();
     }
     return $view;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:11,代码来源:ViewRenderer.php

示例2: renderComponent

 /**
  * Render the component.
  *
  * @param   string  $option  The component option.
  * @param   array   $params  The component parameters
  *
  * @return  object
  *
  * @since   11.1
  */
 public static function renderComponent($option, $params = array())
 {
     if (!self::isLegacy()) {
         return \Component::render($option, $params);
     }
     // Initialise variables.
     $app = JFactory::getApplication();
     // Load template language files.
     $template = $app->getTemplate(true)->template;
     $lang = JFactory::getLanguage();
     $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, JPATH_THEMES . "/{$template}", null, false, true);
     if (empty($option)) {
         // Throw 404 if no component
         JError::raiseError(404, JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND'));
         return;
     }
     // Record the scope
     $scope = $app->scope;
     // Set scope to component name
     $app->scope = $option;
     // Build the component path.
     $option = preg_replace('/[^A-Z0-9_\\.-]/i', '', $option);
     $file = substr($option, 4);
     // Define component path.
     define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option);
     define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option);
     define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option);
     // Get component path
     if ($app->isAdmin() && file_exists(JPATH_COMPONENT . '/admin.' . $file . '.php')) {
         JLog::add('Files in the format admin.COMPONENTNAME.php are considered deprecated and will not be loaded in Joomla 3.0.', JLog::WARNING, 'deprecated');
         $path = JPATH_COMPONENT . '/admin.' . $file . '.php';
     } else {
         $path = JPATH_COMPONENT . '/' . $file . '.php';
     }
     // [!] HUBZERO - Set path and constants for combined components
     $client = $app->isAdmin() ? 'admin' : 'site';
     // Get component path
     if (is_dir(JPATH_SITE . '/components/' . $option . '/' . $client)) {
         define('JPATH_COMPONENT', JPATH_SITE . '/components/' . $option . '/' . $client);
         define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option . '/site');
         define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_SITE . '/components/' . $option . '/admin');
     } else {
         define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option);
         define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option);
         define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option);
     }
     $path = JPATH_COMPONENT . '/' . $file . '.php';
     // [!] HUBZERO - END Set path and constants for combined components
     // If component is disabled throw error
     if (!self::isEnabled($option) || !file_exists($path)) {
         JError::raiseError(404, JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND'));
     }
     $task = JRequest::getString('task');
     // Load common and local language files.
     $lang->load($option, JPATH_BASE, null, false, true) || $lang->load($option, JPATH_COMPONENT, null, false, true);
     // Handle template preview outlining.
     $contents = null;
     // Execute the component.
     $contents = self::executeComponent($path);
     // Revert the scope
     $app->scope = $scope;
     return $contents;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:73,代码来源:helper.php

示例3: renderNow

 /**
  * Force an update on a specified component
  *
  * @param Component $c
  *
  * @return void
  */
 public function renderNow(Component $c)
 {
     ob_start();
     $c->render();
     $this->response->setUpdate($c->getDivId(), ob_get_clean());
 }
开发者ID:stevencoulter,项目名称:cricket,代码行数:13,代码来源:AjaxResponseManager.php

示例4: renderChild

 protected function renderChild(Component $child)
 {
     $child->render();
 }
开发者ID:picon,项目名称:picon-framework,代码行数:4,代码来源:AbstractRepeater.php


注:本文中的Component::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。