當前位置: 首頁>>代碼示例>>PHP>>正文


PHP self::render方法代碼示例

本文整理匯總了PHP中self::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP self::render方法的具體用法?PHP self::render怎麽用?PHP self::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在self的用法示例。


在下文中一共展示了self::render方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generate

 /**
  * Generates a printer friendly version of a page
  *
  * @param	string	$content	The HTML content of the page
  * @param	string	$title		The title of the page
  * @param	string	$description	The description of the page
  * @param	string	$pagetitle
  * @param	int		$width		The width of the page, in pixels
  */
 public static function generate($content, $title = FALSE, $description = FALSE, $pagetitle = FALSE, $width = 680)
 {
     $PrintDataBuilder = new self($content, $title, $description);
     $PrintDataBuilder->setPageTitle($pagetitle);
     $PrintDataBuilder->setWidth($width);
     $PrintDataBuilder->render();
 }
開發者ID:nao-pon,項目名稱:impresscms,代碼行數:16,代碼來源:Printerfriendly.php

示例2: includeTemplate

 /**
  *
  * @param unknown_type $template
  * @param unknown_type $data
  * @return string
  */
 protected function includeTemplate($template, $data = null)
 {
     $view = new self();
     $view->setTemplate($template);
     $view->copyAll($data);
     return $view->render();
 }
開發者ID:rutkoski,項目名稱:simplify,代碼行數:13,代碼來源:Twig.php

示例3: process

 /**
  * Process partial render
  */
 public static function process($nodeList, $template)
 {
     $renderer = new self();
     // @todo: use getInstance() ?
     $renderer->addNodes($nodeList);
     $renderer->setTemplate($template);
     return $renderer->render();
 }
開發者ID:kandy,項目名稱:system,代碼行數:11,代碼來源:PartialRenderer.php

示例4: wrap

 /**
  * Wrap the content of the current template with the given template file.
  *
  * Esentially, this is clearing the output buffer and refilling it with a wrapped
  * version of what was previously in the output buffer.
  *
  * @param string $file_name
  * @param array  $data
  *
  * @return void
  */
 protected function wrap($file_name, array $data = array())
 {
     $data['wrapped_content'] = ob_get_contents();
     ob_end_clean();
     ob_start();
     $wrapper = new self();
     echo $wrapper->render($file_name, $data);
 }
開發者ID:triplepoint,項目名稱:groundhog-template-renderer,代碼行數:19,代碼來源:TemplateRendererPhp.php

示例5: metabox_callback

 public static function metabox_callback($post)
 {
     $listing = WPBDP_Listing::get($post->ID);
     if (!$listing) {
         return '';
     }
     $instance = new self($listing);
     return $instance->render();
 }
開發者ID:Nedick,項目名稱:stzagora-website,代碼行數:9,代碼來源:class-listing-fields-metabox.php

示例6: renderFromHtml

 /**
  * Helper function to render a string of HTML direct to BB code.
  *
  * @param string $html
  * @param array $options
  *
  * @return string BB code
  */
 public static function renderFromHtml($html, array $options = array())
 {
     //echo '<pre>' . htmlspecialchars($html) . '</pre>'; exit;
     $parser = new XenForo_Html_Parser($html);
     $renderer = new self($options);
     $parsed = $parser->parse();
     //$parser->printTags($parsed);
     $rendered = $renderer->render($parsed);
     //echo '<pre>' . htmlspecialchars($rendered) . '</pre>'; exit;
     return self::filterBbCode($rendered);
 }
開發者ID:hahuunguyen,項目名稱:DTUI_201105,代碼行數:19,代碼來源:BbCode.php

示例7: partial

 public function partial($sViewScript, $mBind = null)
 {
     $partial = new self();
     if (null === $mBind) {
         $mBind = get_object_vars($this);
     }
     foreach ($mBind as $key => $val) {
         $partial->{$key} = $val;
     }
     $partial->setView($sViewScript);
     return $partial->render();
 }
開發者ID:nexces,項目名稱:transys,代碼行數:12,代碼來源:view.php

示例8: display

 public static function display($templateFile = "")
 {
     $view = new self();
     $view->templateFile = !empty($templateFile) ? $templateFile : $view->templateFile;
     $myfile_content = file_get_contents($view->viewFile);
     $myfile_content = $view->tag_replace($myfile_content);
     $view->create_template($view->templateFile_c, $myfile_content);
     $content = $view->fetch($view->templateFile_c . ".php");
     $view->create_template($view->templateFile, $content);
     // 輸出模板內容
     $view->render($content);
 }
開發者ID:lixinhan,項目名稱:JiongPHP,代碼行數:12,代碼來源:View.class.php

示例9: show

 public static function show($msg, $type = 'INFO')
 {
     $cli = new self(array('boot'));
     $cli->render($msg, $type);
 }
開發者ID:schpill,項目名稱:thin,代碼行數:5,代碼來源:Cli.php

示例10: build

 /**
  * Static function allows to quickly generarte tag
  * 
  * @param type $tag
  * @param type $attr
  * @param type $html
  * @return type
  */
 public static function build($tag, $attr = array(), $html = null)
 {
     $helper = new self($tag, $attr, $html);
     return $helper->render();
 }
開發者ID:hemangsk,項目名稱:TCB,代碼行數:13,代碼來源:class-html.php

示例11: send

 /**
  * Send the stylesheet to the client
  *
  * Does not cache the stylesheet if the HTTP header Cache-Control or Pragma is set to no-cache.
  *
  * @param   bool    $minified   Whether to compress the stylesheet
  */
 public static function send($minified = false)
 {
     $styleSheet = new self();
     $request = $styleSheet->app->getRequest();
     $response = $styleSheet->app->getResponse();
     $noCache = $request->getHeader('Cache-Control') === 'no-cache' || $request->getHeader('Pragma') === 'no-cache';
     if (!$noCache && FileCache::etagMatchesFiles($styleSheet->lessCompiler->getLessFiles())) {
         $response->setHttpResponseCode(304)->sendHeaders();
         return;
     }
     $etag = FileCache::etagForFiles($styleSheet->lessCompiler->getLessFiles());
     $response->setHeader('Cache-Control', 'public', true)->setHeader('ETag', $etag, true)->setHeader('Content-Type', 'text/css', true);
     $cacheFile = 'icinga-' . $etag . ($minified ? '.min' : '') . '.css';
     $cache = FileCache::instance();
     if (!$noCache && $cache->has($cacheFile)) {
         $response->setBody($cache->get($cacheFile));
     } else {
         $css = $styleSheet->render($minified);
         $response->setBody($css);
         $cache->store($cacheFile, $css);
     }
     $response->sendResponse();
 }
開發者ID:kobmaki,項目名稱:icingaweb2,代碼行數:30,代碼來源:StyleSheet.php

示例12: partialLoop

 /**
  * Given a template name, and a list of variable arrays, this method will
  * iterate through all the sets of variables, rendering the template with
  * each set, and concatenating them together. Could be used for looping
  * through a complex list, where each list element would be too much HTML
  * to cleanly place in the main template itself.
  *
  * @param  string $template Path to template file.
  * @param  array  $varArray Array of associative arrays containing
  *                          template variables.
  * @return string All rendered templates concatenated together.
  */
 public function partialLoop($template, array $varArray = array())
 {
     $t = new self($template);
     $s = '';
     foreach ($varArray as $index => $vars) {
         $t->clear();
         $t->set($vars);
         $t->set('loopIndex', $index);
         $s .= $t->render();
     }
     return $s;
 }
開發者ID:laiello,項目名稱:crindigan,代碼行數:24,代碼來源:Template.php

示例13: renderStatic

 /**
  *	Returns Data Source Name String.
  *	@access		public
  *	@static
  *	@param		string		$driver			Database Driver (cubrid|dblib|firebird|informix|mysql|mssql|oci|odbc|pgsql|sqlite|sybase)
  *	@param		string		$database		Database Name
  *	@param		string		$host			Host Name or URI
  *	@param		int			$port			Host Port
  *	@param		string		$username		Username
  *	@param		string		$password		Password
  *	@return		string
  */
 public static function renderStatic($driver, $database, $host = NULL, $port = NULL, $username = NULL, $password = NULL)
 {
     $dsn = new self($driver, $database);
     $dsn->setHost($host);
     $dsn->setPort($port);
     $dsn->setUsername($username);
     $dsn->setPassword($password);
     return $dsn->render();
 }
開發者ID:CeusMedia,項目名稱:Database,代碼行數:21,代碼來源:DataSourceName.php

示例14: renderPartial

 /**
  * Render the requested partial.
  *
  * @access protected
  * @param string $tag_name
  * @param array $context
  * @return string
  */
 protected function renderPartial($tag_name, &$context)
 {
     $view = new self($this->getPartial($tag_name), $context, $this->partials);
     $view->otag = $this->otag;
     $view->ctag = $this->ctag;
     return $view->render();
 }
開發者ID:kennethreitz-archive,項目名稱:wp-mustache,代碼行數:15,代碼來源:Mustache.php

示例15: simpleRender

 /**
  * 快速render
  * 
  * @return 
  * @param string $template_file_or_string
  * @param array $context
  * @param boolean $cache
  * @param boolean $output
  */
 public static function simpleRender($template_file_or_string, $context, $cache = false, $output = true)
 {
     $result = null;
     if ($cache) {
         $cache_name = self::getCacheName($template_file_or_string, 'html');
         if (file_exists($cache_name)) {
             $result = file_get_contents($cache_name);
             if (!$result) {
                 $result = null;
             }
         }
     }
     if (null === $result) {
         $t = new self($template_file_or_string);
         $result = $t->render($context);
         if ($cache) {
             file_put_contents($cache_name, $result);
         }
     }
     if ($output) {
         echo $result;
     } else {
         return $result;
     }
 }
開發者ID:kim-test,項目名稱:test,代碼行數:34,代碼來源:Shine.php


注:本文中的self::render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。