- concrete5 Cookbook
- David Strack
- 113字
- 2021-08-13 16:15:57
Getting a page's path
In addition to being able to get a page's ID, developers can also retrieve the path for a page. In this recipe, we will load a page by its ID and then retrieve its path.
How to do it...
The steps for getting a page's path are as follows:
- Open
/config/site_post.php
in your preferred code editor. - Load the page by its ID. We will use the ID of
4
here, which should belong to a page on the dashboard.$page = Page::getByID(4);
- Get the page's path.
$path = $page->getCollectionPath();
- Use the custom debugging function to output the path.
my_debug($path);
See also
- The Getting a page by its ID recipe
推薦閱讀
- Visual C++實例精通
- 數據庫系統原理及MySQL應用教程
- Data Analysis with Stata
- Interactive Applications Using Matplotlib
- Julia Cookbook
- Apache Mesos Essentials
- Raspberry Pi Home Automation with Arduino(Second Edition)
- 現代C++編程實戰:132個核心技巧示例(原書第2版)
- OpenCV 3 Blueprints
- H5+移動營銷設計寶典
- Mastering Unreal Engine 4.X
- IBM DB2 9.7 Advanced Application Developer Cookbook
- Spring MVC Blueprints
- Learning PrimeFaces Extensions Development
- Oracle 11g寶典