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

  • 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:

  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
主站蜘蛛池模板: 桐城市| 方城县| 当雄县| 乌兰察布市| 岑巩县| 盈江县| 岳阳市| 慈溪市| 涞源县| 大渡口区| 平舆县| 攀枝花市| 岐山县| 榆中县| 翁源县| 鄂托克前旗| 青铜峡市| 崇左市| 博客| 莱芜市| 扶沟县| 阳原县| 镇坪县| 获嘉县| 石屏县| 浑源县| 南丰县| 饶平县| 凭祥市| 资中县| 平南县| 甘肃省| 雷山县| 龙川县| 丰原市| 屯昌县| 阿拉善左旗| 航空| 新泰市| 宁化县| 齐齐哈尔市|