- 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
推薦閱讀
- Java多線程編程實戰指南:設計模式篇(第2版)
- Learn TypeScript 3 by Building Web Applications
- Visual FoxPro程序設計教程(第3版)
- Rust Cookbook
- Unity Game Development Scripting
- Building RESTful Python Web Services
- Python數據結構與算法(視頻教學版)
- 單片機C語言程序設計實訓100例
- Python High Performance Programming
- Learning Modular Java Programming
- 微課學人工智能Python編程
- Android移動應用開發項目教程
- 分布式架構原理與實踐
- Python預測之美:數據分析與算法實戰(雙色)
- 零基礎學Java第2版