當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。