当前位置: 首页>>代码示例>>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;未经允许,请勿转载。