本文整理匯總了PHP中Backend\Core\Engine\Model::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::has方法的具體用法?PHP Model::has怎麽用?PHP Model::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Backend\Core\Engine\Model
的用法示例。
在下文中一共展示了Model::has方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: configureOptions
public function configureOptions(OptionsResolver $optionsResolver)
{
$optionsResolver->setDefaults(['attr' => ['class' => 'inputEditor']]);
if (!Model::has('header')) {
return;
}
// add the needed javascript to the header;
$header = Model::get('header');
// we add JS because we need CKEditor
$header->addJS('ckeditor/ckeditor.js', 'Core', false);
$header->addJS('ckeditor/adapters/jquery.js', 'Core', false);
$header->addJS('ckfinder/ckfinder.js', 'Core', false);
// add the internal link lists-file
if (is_file(FRONTEND_CACHE_PATH . '/Navigation/editor_link_list_' . Language::getWorkingLanguage() . '.js')) {
$timestamp = @filemtime(FRONTEND_CACHE_PATH . '/Navigation/editor_link_list_' . Language::getWorkingLanguage() . '.js');
$header->addJS('/src/Frontend/Cache/Navigation/editor_link_list_' . Language::getWorkingLanguage() . '.js?m=' . $timestamp, null, false, true, false);
}
}
示例2: parseVars
/**
* Parse some vars
*/
private function parseVars()
{
// assign a placeholder var
$this->assign('var', '');
// assign current timestamp
$this->assign('timestamp', time());
// check on url object
if (Model::getContainer()->has('url')) {
$url = Model::get('url');
if ($url instanceof Url) {
$this->assign('bodyID', \SpoonFilter::toCamelCase($url->getModule(), '_', true));
// build classes
$bodyClass = \SpoonFilter::toCamelCase($url->getModule() . '_' . $url->getAction(), '_', true);
// special occasions
if ($url->getAction() == 'add' || $url->getAction() == 'edit') {
$bodyClass = $url->getModule() . 'AddEdit';
}
// assign
$this->assign('bodyClass', $bodyClass);
}
}
if (Model::has('navigation')) {
$navigation = Model::get('navigation');
if ($navigation instanceof Navigation) {
$navigation->parse($this);
}
}
foreach ($this->forms as $form) {
if ($form->isSubmitted() && !$form->isCorrect()) {
$this->assign('form_error', true);
break;
}
}
$this->assign('cookies', Model::get('request')->cookies->all());
}