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

Getting a page's handle

Pages, like page types and other objects in concrete5, have handles in addition to paths. The handle is similar to a slug in other content management systems. In this exercise, we will load a page by its ID and then retrieve its handle.

How to do it...

The steps for getting a page's handle are as follows:

  1. Open /config/site_post.php in your code editor.
  2. Load the page by its ID.
    $page = Page::getByID(4);
  3. Get the page's handle.
    $handle = $page->getCollectionHandle();
  4. Dump the handle variable to see its contents.
    my_debug($handle);

See also

  • The Getting a page by its ID recipe
主站蜘蛛池模板: 岑巩县| 岑巩县| 荆州市| 鸡泽县| 万年县| 桓台县| 沙洋县| 綦江县| 富顺县| 类乌齐县| 东山县| 汪清县| 松江区| 安丘市| 长海县| 新绛县| 庆安县| 朔州市| 威信县| 马山县| 沅江市| 盈江县| 蓝田县| 青海省| 安顺市| 上饶市| 武宁县| 新竹市| 兰坪| 电白县| 富裕县| 陆良县| 安庆市| 长阳| 那曲县| 兴和县| 辽宁省| 庆阳市| 长汀县| 隆回县| 旬阳县|