本文整理匯總了PHP中TemplateEngine::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP TemplateEngine::getInstance方法的具體用法?PHP TemplateEngine::getInstance怎麽用?PHP TemplateEngine::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TemplateEngine
的用法示例。
在下文中一共展示了TemplateEngine::getInstance方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeRender
public function beforeRender()
{
$menuSource = "";
foreach ($this->menuEntries as $name => $link) {
$menuSource .= '<li><a href="' . $link . '">' . $name . '</a></li>';
}
TemplateEngine::getInstance()->replaceMarks("menu", $menuSource);
}
示例2: __construct
private function __construct()
{
$this->classloader = Classloader::getInstance();
$this->classloader->initLoadLib();
$this->dataConnector = DataConnector::getInstance();
$this->routingEngine = RoutingEngine::getInstance();
$this->templateEngine = TemplateEngine::getInstance();
}
示例3: capitalize
public static function capitalize($str, $lc_rest = true)
{
TemplateEngine::getInstance()->loadPlugin('smarty_modifier_capitalize');
return smarty_modifier_capitalize($str, false, $lc_rest);
}
示例4: renderAsHTML
/**
* Normal render
* @param string $view
*/
public function renderAsHTML($view = 'index')
{
$routingEngine = RoutingEngine::getInstance();
$templateEngine = TemplateEngine::getInstance();
$templateEngine->loadDesign();
$templateEngine->loadView($routingEngine->controller, $routingEngine->action);
$templateEngine->setTitle($routingEngine->controller . ' > ' . $routingEngine->action);
$templateEngine->render($this);
}
示例5: setTitle
/**
* Defines the Title tag
* @param string $title
*/
public function setTitle($title)
{
$templateEngine = TemplateEngine::getInstance();
$templateEngine->setTitle($title);
Log::getInstance()->event("Titel: " . $title, Log::INFO);
}
示例6: init
public function init()
{
Log::getInstance()->event("Loaded my Plugin", Log::INFO);
TemplateEngine::getInstance()->replaceMarks("info", "Test");
}