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

Getting a page's page type handle

In addition to being able to retrieve the ID of a page's page type, developers can also get the handle.

How to do it...

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

  1. Open /config/site_post.php in your code editor, since we will just be running some arbitrary code.
  2. Load the page by its path.
    $page = Page::getByPath('/about');
  3. Get the page type handle.
    $handle = $page->getCollectionTypeHandle();
  4. Dump the handle variable to see its contents.
    my_debug($handle);

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 丰县| 绍兴县| 托里县| 志丹县| 民乐县| 临夏县| 罗城| 永仁县| 东乡县| 洞头县| 萨迦县| 七台河市| 澜沧| 临澧县| 崇仁县| 丹寨县| 来安县| 左贡县| 锡林浩特市| 林芝县| 东乌珠穆沁旗| 青川县| 鄂温| 江都市| 桃江县| 宁陵县| 南木林县| 永年县| 阳曲县| 云和县| 永安市| 东明县| 进贤县| 常德市| 会东县| 平远县| 申扎县| 三都| 河池市| 潢川县| 遂昌县|