- 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
推薦閱讀
- Flask Web全棧開發實戰
- Getting Started with React
- Learn Type:Driven Development
- iOS開發實戰:從零基礎到App Store上架
- C語言程序設計案例式教程
- Big Data Analytics
- Linux命令行與shell腳本編程大全(第4版)
- Expert Data Visualization
- Scala程序員面試算法寶典
- INSTANT Yii 1.1 Application Development Starter
- Serverless Web Applications with React and Firebase
- FPGA嵌入式項目開發實戰
- 計算機應用技能實訓教程
- AMP:Building Accelerated Mobile Pages
- Python滲透測試編程技術:方法與實踐(第2版)