- 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
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- 玩轉Scratch少兒趣味編程
- SoapUI Cookbook
- Ext JS Data-driven Application Design
- Oracle 12c中文版數據庫管理、應用與開發實踐教程 (清華電腦學堂)
- Designing Hyper-V Solutions
- Android 7編程入門經典:使用Android Studio 2(第4版)
- Kotlin Standard Library Cookbook
- Unreal Engine 4 Shaders and Effects Cookbook
- Java程序設計
- PySide 6/PyQt 6快速開發與實戰
- Python程序設計與算法基礎教程(第2版)(微課版)
- 時空數據建模及其應用
- 機器學習微積分一本通(Python版)
- 基于GPU加速的計算機視覺編程:使用OpenCV和CUDA實時處理復雜圖像數據