本文整理匯總了PHP中helpers\Assets::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assets::add方法的具體用法?PHP Assets::add怎麽用?PHP Assets::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類helpers\Assets
的用法示例。
在下文中一共展示了Assets::add方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeMethod
public function beforeMethod()
{
$this->mUsers = new mUsers();
$this->auth = new Auth($this->mUsers, $this->config);
if (Dragon::$method != 'login' && !$this->auth->check()) {
$this->router->redirect($this->config->get('project_host'));
}
parent::beforeMethod();
$this->view->setLayout('default');
Assets::add('main', Assets::TYPE_CSS);
Assets::add('default', Assets::TYPE_JS);
}
示例2: index
/**
* Homepage -- default method
*/
public function index()
{
Debug::timer('test');
Assets::add('main', Assets::TYPE_CSS);
Assets::add('default', Assets::TYPE_JS);
/*
* Sample information about access to database data
* Default read:
*/
// $modelSample = new mSample();
// $rows = $modelSample->get();
// Debug::var_dump($rows);
// $modelSample->get(2);
/*
* Sample get instance of component
*/
$componentEmail = new cEmail($this->config, $this->router);
Debug::var_dump('test');
Debug::var_dump([432, 654]);
Debug::timer('test');
$this->set('variable', 'how to set variable to view');
$this->set('links', array('produkt' => $this->router->getUrl('products', 'detail', 123, array('list' => 5))));
}