本文整理汇总了PHP中Cms\Classes\Page::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::all方法的具体用法?PHP Page::all怎么用?PHP Page::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cms\Classes\Page
的用法示例。
在下文中一共展示了Page::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scanForMessages
/**
* Scans the theme templates for message references.
* @return void
*/
public function scanForMessages()
{
$messages = [];
foreach (Layout::all() as $layout) {
$messages = array_merge($messages, $this->parseContent($layout->markup));
}
foreach (Page::all() as $page) {
$messages = array_merge($messages, $this->parseContent($page->markup));
}
foreach (Partial::all() as $partial) {
$messages = array_merge($messages, $this->parseContent($partial->markup));
}
Message::importMessages($messages);
}
示例2: register
public function register()
{
\Event::listen('backend.form.extendFields', function ($widget) {
if (!$widget->model instanceof \Cms\Classes\Page) {
return;
}
if (!($theme = Theme::getEditTheme())) {
throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
}
$pages = Page::all()->sort(function ($a, $b) {
return strcasecmp($a->title, $b->title);
});
$pageOptions = $this->buildPageOptions($pages);
$widget->addFields(['settings[child_of]' => ['label' => 'Child Of', 'type' => 'dropdown', 'tab' => 'Breadcrumbs', 'span' => 'left', 'options' => $pageOptions, 'comment' => 'The parent of this page. Set to "None" if root page'], 'settings[hide_crumb]' => ['label' => 'Hide Breadcrumbs', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Hide the breadcrumb trail on this page'], 'settings[crumb_title]' => ['label' => 'Crumb Title (Optional)', 'type' => 'text', 'tab' => 'Breadcrumbs', 'span' => 'left', 'comment' => 'Title text for this pages crumb, by default will use page title'], 'settings[remove_crumb_trail]' => ['label' => 'Remove From Breadcrumbs', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Do not show this page in the breadcrumb trail'], 'settings[crumbElementTitle]' => ['label' => 'Crumb Title From Id (Optional)', 'type' => 'text', 'tab' => 'Breadcrumbs', 'span' => 'left', 'comment' => 'Use a DOM element as the crumb title for this page. Must be a a unique #id on the page.'], 'settings[crumb_disabled]' => ['label' => 'Disabled', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Disable the link and add the disabled class to this crumb item in the breadcrumb list']], 'primary');
});
}
示例3: onRun
public function onRun()
{
$this->pages = $this->page['pages'] = Page::all();
$this->dependencyString = $this->page['dependencyString'] = $this->getModuleDependencies();
}