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


PHP type::render方法代码示例

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


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

示例1: displayTemplate

 /**
  * Display a template
  * @param string $name The Template Name
  * @param mixed  $data Array/Object with data to merge
  *
  * @return string
  */
 public function displayTemplate($name, $data = array())
 {
     if ($this->debug) {
         $data = array_merge($data, array('debug' => true));
     }
     return $this->twig->render($name, $data);
 }
开发者ID:rafaelgou,项目名称:PHPBol,代码行数:14,代码来源:AbstractTemplate.php

示例2: form

 /**
  * Generates the administration form for the widget
  * 
  * @param array $instance    The array of keys and 
  *                            values for the widget
  */
 public function form($instance)
 {
     // Reset the names so that the form's update function works properly
     foreach ($this->config->fields as $field) {
         $field->name = $field->init_name;
     }
     // Update values
     $this->form->updater->set_new_instance($instance);
     $this->form->updater->update();
     // Set the widget specific field names and ids
     foreach ($this->config->fields as $field) {
         $field->id = $this->get_field_id($field->init_name);
         $field->name = $this->get_field_name($field->init_name);
     }
     // Print the form
     $this->form->render(true);
 }
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:23,代码来源:Widget.php

示例3: prepareFields

 /**
  * Prepare fields for table
  *
  * @param type $user
  * @return type
  */
 public function prepareFields($user, $key)
 {
     switch ($key) {
         case 'login':
             return $user->render('list', 'avatar.small');
             break;
         case 'reg_date':
             return df($user->reg_date, 'd M Y');
             break;
         case 'posts':
             return '<a href="' . $user->getLink() . '/posts/" class="badge' . ($user->posts > 0 ? ' badge-info' : '') . '">' . $user->posts . '</a>';
             break;
         case 'comments':
             return '<a href="' . $user->getLink() . '/comments/" class="badge' . ($user->comments > 0 ? ' badge-warning' : '') . '">' . $user->comments . '</a>';
             break;
     }
 }
开发者ID:brussens,项目名称:cogear2,代码行数:23,代码来源:List.php

示例4: _render

 /**
  * Render the menu
  * @param array $menu_items
  * @param array $attributes
  * @param int $level
  * @return type
  */
 private function _render($menu_items, $attributes, $level = null, $group = null, $currentDepth = 0)
 {
     if ($level !== null && $level-- <= 0) {
         return;
     }
     $items = array();
     foreach ($menu_items as $item) {
         if (isset($group, $item['group']) && !in_array($group, explode(',', $item['group']))) {
             continue;
         }
         isset($item['list_attributes']) or $item['list_attributes'] = array();
         if ($this->is_active($item) || $this->has_active_children($item)) {
             isset($item['list_attributes']['class']) or $item['list_attributes']['class'] = '';
             $item['list_attributes']['class'] .= 'active';
         }
         $item['pages'] = isset($item['pages']) ? $this->_render($item['pages'], array(), $level, $group, $currentDepth + 1) : '';
         $items[] = $this->renderer->render_item($this, $item);
     }
     $str_items = implode(PHP_EOL, $items);
     return $this->renderer->render($this, $str_items, $attributes, $currentDepth);
 }
开发者ID:joegreen0991,项目名称:smartnav,代码行数:28,代码来源:Menu.php

示例5: renderMainLayout

 /**
  * Renders main layout.
  */
 protected function renderMainLayout($content, $pageTitle, $dirPrefix = '', $langCode = 'en')
 {
     $vars = ['bookTitle' => $this->bookProps['book_title'], 'bookSubtitle' => $this->bookProps['book_subtitle'], 'keywords' => implode(',', $this->bookProps['keywords']), 'pageTitle' => $pageTitle, 'copyright' => $this->bookProps['copyright'], 'links' => $this->bookProps['links'], 'content' => $content, 'dirPrefix' => $dirPrefix, 'bookProps' => $this->bookProps, 'langCode' => $langCode];
     $html = $this->phpRenderer->render("data/theme/default/layout/main.php", $vars);
     return $html;
 }
开发者ID:olegkrivtsov,项目名称:openbook,代码行数:9,代码来源:BookGenerator.php

示例6: render

 /**
  * render
  * 
  * render function displays the view.
  * Question Time: What if I use desctructor to render the view?
  * @return void
  */
 protected function render()
 {
     $this->view->render();
 }
开发者ID:gitter-badger,项目名称:Mist-1,代码行数:11,代码来源:Controller.php


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