書名: concrete5 Cookbook作者名: David Strack本章字數: 85字更新時間: 2021-08-13 16:15:58
Getting a page's name
Page names are often used as the de facto titles in concrete5. In this exercise, we will load a page by its path, and then get its name.
How to do it...
The steps for getting a page's name are as follows:
- Open
/config/site_post.php
in your editor. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the page's title.
$name = $page->getCollectionName();
- Dump the contents of the title variable.
my_debug($name);
See also
- The Getting a page by its path recipe
推薦閱讀
- Java面向對象思想與程序設計
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- Python從入門到精通(精粹版)
- Java程序員面試算法寶典
- INSTANT Mercurial SCM Essentials How-to
- Nginx實戰:基于Lua語言的配置、開發與架構詳解
- C語言程序設計
- 軟件測試綜合技術
- Everyday Data Structures
- 平面設計經典案例教程:CorelDRAW X6
- Java EE架構設計與開發實踐
- Groovy 2 Cookbook
- Spark技術內幕:深入解析Spark內核架構設計與實現原理
- R語言實戰(第2版)
- Learning ArcGIS Geodatabases