本文整理汇总了PHP中Application::getSmarty方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getSmarty方法的具体用法?PHP Application::getSmarty怎么用?PHP Application::getSmarty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::getSmarty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commonLogic
protected function commonLogic(&$params = array())
{
parent::commonLogic($params);
$this->filter = Application::getFilter($this->getObjectName());
$smarty = Application::getSmarty();
$smarty->assign('filter', $this->filter);
}
示例2: beforeListLoad
protected function beforeListLoad(&$load_params)
{
$filter = Application::getFilter('user');
$filter->set_params($load_params);
$smarty = Application::getSmarty();
$smarty->assign('test', 'test');
$smarty->assign('filter', $filter);
}
示例3: render
public function render()
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
Application::loadLibrary('olmi/request');
Application::loadLibrary('core/router');
$url = ltrim($_SERVER['REQUEST_URI'], '/');
$user_session = Application::getUserSession();
$user_logged = $user_session->getUserAccount();
Router::setDefaultModuleName($user_logged ? 'profile' : 'login');
Router::route($url);
$page = Application::getPage();
$page = Application::getPage();
$page->setTitle('OCS');
$page->addMeta(array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
$page->addMeta(array('charset' => 'utf-8'));
$page->addStylesheet(coreResourceLibrary::getStaticPath('/bootstrap/css/bootstrap.min.css'));
$page->addStylesheet(coreResourceLibrary::getStaticPath('/bootstrap/css/bootstrap-theme.min.css'));
$page->addStylesheet(coreResourceLibrary::getStaticPath('jquery-ui/jquery-ui-bootstrap.css'));
$page->addStylesheet(coreResourceLibrary::getStaticPath('/css/admin.css'));
$page->addScript(coreResourceLibrary::getStaticPath('/js/jquery-1.11.3.min.js'));
$page->addScript(coreResourceLibrary::getStaticPath('/jquery-ui/jquery-ui.min.js'));
$page->addScript(coreResourceLibrary::getStaticPath('/bootstrap/js/bootstrap.min.js'));
$page->addScript(coreResourceLibrary::getStaticPath('/js/application.js'));
$page->addLiteral('
<script type="text/javascript">
jQuery(document).ready(function(){
App.init();
});
</script>
');
$smarty = Application::getSmarty();
$module_name = Router::getModuleName();
$module_params = Router::getModuleParams();
if ($module_name) {
$module = Application::getResourceInstance('module', $module_name);
if (coreAccessControlLibrary::accessAllowed($user_logged, $module)) {
$content = call_user_func(array($module, 'run'), $module_params);
} else {
Application::stackError(Application::gettext('You have no permission to login'));
$user_session->logout();
Redirector::redirect(Application::getSeoUrl('/login?back=' . Router::getSourceUrl()));
}
} else {
$content = Application::runModule('page404');
}
$smarty->assign('content', $content);
$html_head = $page->getHtmlHead();
$smarty->assign('html_head', $html_head);
/*$smarty->assign('header', Application::getBlock('header'));
$smarty->assign('footer', Application::getBlock('footer'));*/
$template_path = coreResourceLibrary::getTemplatePath('index');
$smarty->display($template_path);
}
示例4: render
public function render()
{
$user_session = Application::getUserSession();
if (!$user_session->userLogged()) {
return $this->terminate();
}
$smarty = Application::getSmarty();
$smarty->assign('user_logged', $user_session->getUserAccount());
$smarty->assign('logout_link', Application::getSeoUrl('/login/logout'));
$smarty->assign('block', $this);
$template_path = $this->getTemplatePath();
return $smarty->fetch($template_path);
}
示例5: render
public function render()
{
$menu = array();
$menu['Пользователи'] = Application::getSeoUrl('/user');
$menu['Страницы'] = Application::getSeoUrl('/admin_document');
$menu['Новости'] = Application::getSeoUrl('/news');
$menu['OCS'] = array('Клиенты' => Application::getSeoUrl('/ocs_client'), 'Рекламные каналы' => Application::getSeoUrl('/ocs_channel'), 'Заявки' => Application::getSeoUrl('/ocs_order'));
$menu['Настройки'] = Application::getSeoUrl('/settings');
$menu['Выйти'] = Application::getSeoUrl('/login/logout');
$smarty = Application::getSmarty();
$smarty->assign('menu', $menu);
$template_path = $this->getTemplatePath();
return $smarty->fetch($template_path);
}
示例6: render
public function render()
{
$user_session = Application::getUserSession();
if (!$user_session->userLogged()) {
return $this->terminate();
}
$smarty = Application::getSmarty();
$smarty->assign('top_menu', Application::getBlock('menu'));
$smarty->assign('user_logged', $user_session->getUserAccount());
$smarty->assign('logout_link', Application::getSeoUrl('/login/logout'));
$smarty->assign('site_logo', coreResourceLibrary::getStaticPath('/img/site_logo.jpg'));
$template_path = $this->getTemplatePath();
return $smarty->fetch($template_path);
}
示例7: SnacktoolsRequest
<?php
$request = new SnacktoolsRequest('get_user');
$request->addParam('id', $_GET['id']);
$response = $request->request();
$smarty = Application::getSmarty('/admin/ajax/templates/', '/admin/ajax/templates_c/');
$smarty->assign('user', $response->data['user']);
$out = $smarty->fetch('get-user-details.tpl');
Ajax::output($out);
示例8: run
public function run($params = array())
{
$smarty = Application::getSmarty();
$smarty->assign('message_stack', Application::getBlock('message_stack'));
return parent::run($params);
}
示例9: isset
<?php
$smarty = Application::getSmarty('ajax/templates', 'ajax/templates_c');
$width = isset($_GET['width']) ? $_GET['width'] : 0;
$height = isset($_GET['height']) ? $_GET['height'] : 0;
$sizes = QuizSize::getAllSizes();
$maxSize = QuizSize::getMax($sizes);
$smarty->assign('sizes', $sizes);
$smarty->assign('width', $width);
$smarty->assign('height', $height);
$smarty->assign('widgetMaxWidth', Settings::getValueByName('widget_max_width'));
$smarty->assign('widgetMinWidth', Settings::getValueByName('widget_min_width'));
$smarty->assign('widgetMaxHeight', Settings::getValueByName('widget_max_height'));
$smarty->assign('widgetMinHeight', Settings::getValueByName('widget_min_height'));
Ajax::output($smarty->fetch('get_sizes.tpl'));