- concrete5 Cookbook
- David Strack
- 102字
- 2021-08-13 16:15:58
Getting a page's handle
Pages, like page types and other objects in concrete5, have handles in addition to paths. The handle is similar to a slug in other content management systems. In this exercise, we will load a page by its ID and then retrieve its handle.
How to do it...
The steps for getting a page's handle are as follows:
- Open
/config/site_post.php
in your code editor. - Load the page by its ID.
$page = Page::getByID(4);
- Get the page's handle.
$handle = $page->getCollectionHandle();
- Dump the handle variable to see its contents.
my_debug($handle);
See also
- The Getting a page by its ID recipe
推薦閱讀
- 大話PLC(輕松動漫版)
- 深入淺出Electron:原理、工程與實踐
- Flask Web開發入門、進階與實戰
- Android 7編程入門經典:使用Android Studio 2(第4版)
- Redis Essentials
- Swift語言實戰精講
- Python算法詳解
- Practical Game Design with Unity and Playmaker
- Android開發三劍客:UML、模式與測試
- 計算機應用基礎教程(Windows 7+Office 2010)
- Node.js開發指南
- Managing Microsoft Hybrid Clouds
- 零基礎學Scratch 3.0編程
- 物聯網系統架構設計與邊緣計算(原書第2版)
- Mastering Apache Camel