官术网_书友最值得收藏!

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:

  1. Open /config/site_post.php in your preferred code editor.
  2. 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);
  3. Get the page's path.
    $path = $page->getCollectionPath();
  4. Use the custom debugging function to output the path.
    my_debug($path);

See also

  • The Getting a page by its ID recipe
主站蜘蛛池模板: 富阳市| 永州市| 宜阳县| 韶山市| 达拉特旗| 银川市| 新邵县| 五华县| 石林| 甘泉县| 沙河市| 汉川市| 化州市| 甘谷县| 宝清县| 乌审旗| 武强县| 方山县| 杭锦旗| 定日县| 元谋县| 象州县| 抚州市| 锡林郭勒盟| 扎鲁特旗| 松桃| 庆城县| 花垣县| 股票| 都兰县| 宜阳县| 电白县| 黔东| 高青县| 留坝县| 汉川市| 邵阳市| 柘城县| 洛南县| 邢台市| 祁门县|