Menu

The TPage class: page title and icon

Although you can set basic page properties upon construction, it may be more practical to do so by setting one property a time.

Title

The title of the page (that will appear in the window title bar and when you bookmark the page) is the first parameter to be passed when creating a page. If you prefer, you can set it later. Ex.:

<?php
$page = TPage('Welcome');

is exactly the same as:

<?php
$page = TPage();
$page->title = 'Welcome';

Icon

This will appear in the address bar, in the tab icon and when you bookmark the page. It is the third parameter passed when creating a page. It defaults to go!Johnny's icon. If you don't want your page to have an icon at all, you can set the page icon to blank or define the constant GJ_DEFAULTICON to a blank string before including the library. Ex.:

<?php
$page = TPage('Welcome', '', 'mypage.ico');

is exactly the same as:

<?php
$page = TPage('Welcome');
$page->icon = 'mypage.ico';
Posted by panglossa 2013-04-09 Labels: page title icon favicon TPage

Log in to post a comment.