- concrete5 Cookbook
- David Strack
- 93字
- 2021-08-13 16:15:58
Getting a page's page type handle
In addition to being able to retrieve the ID of a page's page type, developers can also get the handle.
How to do it...
The steps for getting a page's page type handle are as follows:
- Open
/config/site_post.php
in your code editor, since we will just be running some arbitrary code. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the page type handle.
$handle = $page->getCollectionTypeHandle();
- Dump the handle variable to see its contents.
my_debug($handle);
See also
- The Getting a page by its path recipe
推薦閱讀
- AngularJS深度剖析與最佳實踐
- Java性能權威指南(第2版)
- VMware虛擬化技術
- Oracle 18c 必須掌握的新特性:管理與實戰
- ANSYS Fluent 二次開發指南
- Java EE 8 Application Development
- Python之光:Python編程入門與實戰
- SQL基礎教程(第2版)
- Unity 3D腳本編程:使用C#語言開發跨平臺游戲
- Scala編程(第5版)
- 平面設計經典案例教程:CorelDRAW X6
- Orchestrating Docker
- PhoneGap 4 Mobile Application Development Cookbook
- 高性能PHP 7
- 產品架構評估原理與方法