รูปแบบของ Function settile แบบ Dynamic
โค้ด: เลือกทั้งหมด
$ app = JFactory :: getApplication ();
$ this -> setTitle ( $ title . '-' . $ app -> getCfg ( 'sitename' ) );
โค้ด: เลือกทั้งหมด
function setTitle($title) {
$this->title = $title;
}
โค้ด: เลือกทั้งหมด
<fields name="params">
<field name="comingsoon_title" type="text" default="Coming Soon Title" label="HELIX_COMINGSOON_TITLE"
description="HELIX_COMINGSOON_TITLE_DESC" class="child comingsoon comingsoon_1" />
<dields>
โค้ด: เลือกทั้งหมด
$comingsoon_title = $this->params->get('comingsoon_title');
if( $comingsoon_title ) {
$doc->setTitle( $comingsoon_title . ' | ' . $app->get('sitename') );
}
$comingsoon_date = explode('-', $this->params->get("comingsoon_date"));
ผลลัพธ์ในหน้าตั้งค่า Title ก็จะได้ ผลลัพธ์จากการรันโปรแกรม อ้างอิง
1 https://docs.joomla.org/Customising_the_dynamic_page_title
2 https://docs.joomla.org/API15:JDocument/setTitle
3 https://stackoverflow.com/questions/31454079/set-page-title-in-joomla-3-from-a-module