- 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
推薦閱讀
- Learning Neo4j
- GraphQL學習指南
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- Java EE框架整合開發(fā)入門到實戰(zhàn):Spring+Spring MVC+MyBatis(微課版)
- Building Mapping Applications with QGIS
- 零基礎學Java(第4版)
- 精通Linux(第2版)
- MATLAB 2020從入門到精通
- Web Development with MongoDB and Node(Third Edition)
- Mobile Device Exploitation Cookbook
- Java程序設計案例教程
- ScratchJr趣味編程動手玩:讓孩子用編程講故事
- Android系統(tǒng)下Java編程詳解
- Java高手是怎樣煉成的:原理、方法與實踐
- jMonkeyEngine 3.0 Beginner’s Guide