当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::inTheme方法代码示例

本文整理汇总了PHP中Cms\Classes\Page::inTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::inTheme方法的具体用法?PHP Page::inTheme怎么用?PHP Page::inTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cms\Classes\Page的用法示例。


在下文中一共展示了Page::inTheme方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLists

 public function testLists()
 {
     // Default theme: test
     $pages = Page::lists('baseFileName');
     sort($pages);
     $this->assertEquals(["404", "a/a-page", "ajax-test", "authors", "b/b-page", "blog-archive", "blog-post", "code-namespaces", "component-custom-render", "component-partial", "component-partial-nesting", "component-partial-override", "cycle-test", "index", "no-component", "no-component-class", "no-layout", "no-partial", "optional-full-php-tags", "optional-short-php-tags", "throw-php", "with-component", "with-components", "with-content", "with-layout", "with-partials", "with-placeholder"], $pages);
     $layouts = Layout::lists('baseFileName');
     sort($layouts);
     $this->assertEquals(["a/a-layout", "ajax-test", "content", "cycle-test", "no-php", "partials", "php-parser-test", "placeholder", "sidebar"], $layouts);
     $pages = Page::inTheme('NON_EXISTENT_THEME')->lists('baseFileName');
     $this->assertEmpty($pages);
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:12,代码来源:CmsObjectQueryTest.php

示例2: initCmsPage

 /**
  * Creates a CMS page from a static page and configures it.
  * @param string $url Specifies the static page URL.
  * @return \Cms\Classes\Page Returns the CMS page object or NULL of the requested page was not found.
  */
 public function initCmsPage($url)
 {
     $router = new Router($this->theme);
     $page = $router->findByUrl($url);
     if (!$page) {
         return null;
     }
     $viewBag = $page->viewBag;
     $cmsPage = CmsPage::inTheme($this->theme);
     $cmsPage->url = $url;
     $cmsPage->apiBag['staticPage'] = $page;
     /*
      * Transfer specific values from the content view bag to the page settings object.
      */
     $viewBagToSettings = ['title', 'layout', 'meta_title', 'meta_description', 'is_hidden'];
     foreach ($viewBagToSettings as $property) {
         $cmsPage->settings[$property] = array_get($viewBag, $property);
     }
     return $cmsPage;
 }
开发者ID:rainlab,项目名称:pages-plugin,代码行数:25,代码来源:Controller.php

示例3: onGetTemplateList

 public function onGetTemplateList()
 {
     $this->validateRequestTheme();
     $page = Page::inTheme($this->theme);
     return ['layouts' => $page->getLayoutOptions()];
 }
开发者ID:nerijunior,项目名称:october,代码行数:6,代码来源:Index.php

示例4: testListsNonExistentTheme

 public function testListsNonExistentTheme()
 {
     $pages = Page::inTheme('NON_EXISTENT_THEME')->lists('baseFileName');
     $this->assertEmpty($pages);
 }
开发者ID:nerijunior,项目名称:october,代码行数:5,代码来源:CmsObjectQueryTest.php


注:本文中的Cms\Classes\Page::inTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。