HTML page object.
More...
|
| | __construct () |
| |
| | set_siteInformations ($site_title, $site_author='') |
| |
| | set_pageInformations ($page_title, $page_desc='', $page_keys='', $page_lang='') |
| |
| | set_robotInformations ($index=true, $follow=true) |
| |
| | set_googleInformations ($code='', $domain='') |
| |
| | set_favicon ($favicon=null) |
| |
| | set_charset ($charset='') |
| |
| | set_bodyClass ($class='') |
| |
| | add_meta ($key, $value, $method='name') |
| |
| | add_link ($rel, $href, $params=array()) |
| |
| | add_JSFile ($file='') |
| |
| | add_JSScript ($script='', $unique=false) |
| |
| | add_JSPreScript ($script='', $unique=false) |
| |
| | add_JSWindowEventScript ($event, $script, $unique=false) |
| |
| | add_JSloadScript ($script='', $unique=false) |
| |
| | add_JSunloadScript ($script='', $unique=false) |
| |
| | add_styleFile ($file='', $media='', $condition='') |
| |
| | add_styleScript ($css='') |
| |
| | add_styleIncludedFile ($file='') |
| |
| | add_headerExtra ($content='') |
| |
| | add_RSSFeed ($url='', $title='') |
| |
| | set_redirect ($time, $url) |
| |
| | set_mobileMeta ($enabled=false, $config=array()) |
| |
| | add_structuredData ($data) |
| |
| | write_HTMLContent ($buffer='') |
| |
| | flush ($buffer='') |
| |
| | add_HTMLContent ($content='') |
| |
| | write_HTMLFile ($file='', $buffer='') |
| |
| | add_HTMLHeader () |
| |
| | add_HTMLFooter () |
| |
| | get_doctype () |
| |
| | get_htmlHeader () |
| |
| | get_title () |
| |
| | get_metas () |
| |
| | get_links () |
| |
| | get_JSFiles () |
| |
| | get_JSPreScripts () |
| |
| | get_JSScripts () |
| |
| | get_styleFiles () |
| |
| | get_styleScripts () |
| |
| | get_headerExtras () |
| |
| | get_body () |
| |
| | set_RSSFeed ($url='', $title='') |
| |
HTML page object.
Engine / Object Library
- Author
- CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Version
- 1.0.8.1
- Date
- Creation: Jun 2005
-
Modification: Jul 2025
- Copyright
- 2005 - 2025 CaMykS Team
- Note
- This program is distributed as is - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Todo:
- Try to set up output page parts as private, as they should be only called by add_HTMLHeader().
HTMLPage class.
◆ __construct()
| HTMLPage::__construct |
( |
| ) |
|
◆ set_siteInformations()
| HTMLPage::set_siteInformations |
( |
|
$site_title, |
|
|
|
$site_author = '' |
|
) |
| |
Define site information.
- Parameters
-
| string | $site_title | the website title |
| string | $site_author | the website author |
- Returns
- void
◆ set_pageInformations()
| HTMLPage::set_pageInformations |
( |
|
$page_title, |
|
|
|
$page_desc = '', |
|
|
|
$page_keys = '', |
|
|
|
$page_lang = '' |
|
) |
| |
Define page information.
- Parameters
-
| string | $page_title | the webpage title |
| string | $page_desc | the webpage description meta |
| string | $page_keys | the webpage keywords meta |
| string | $page_lang | the webpage language displayed |
- Returns
- void
◆ set_robotInformations()
| HTMLPage::set_robotInformations |
( |
|
$index = true, |
|
|
|
$follow = true |
|
) |
| |
Define robots information.
- Parameters
-
| boolean | $index | the index value |
| boolean | $follow | the follow value |
- Returns
- void
◆ set_googleInformations()
| HTMLPage::set_googleInformations |
( |
|
$code = '', |
|
|
|
$domain = '' |
|
) |
| |
Define google information.
- Parameters
-
| string | $code | the google code value |
| string | $domain | the google domain value |
- Returns
- void
◆ set_favicon()
| HTMLPage::set_favicon |
( |
|
$favicon = null | ) |
|
Define site favicon.
- Parameters
-
| string | $favicon | the favicon file name |
- Returns
- void
◆ set_charset()
| HTMLPage::set_charset |
( |
|
$charset = '' | ) |
|
Define charset.
- Parameters
-
- Returns
- void
◆ set_bodyClass()
| HTMLPage::set_bodyClass |
( |
|
$class = '' | ) |
|
Define body class.
- Parameters
-
- Returns
- void
◆ add_meta()
| HTMLPage::add_meta |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$method = 'name' |
|
) |
| |
Add a new meta.
- Parameters
-
| string | $key | the meta name |
| string | $value | the meta value |
| string | $method | the meta displaying method |
- Returns
- void
◆ add_link()
| HTMLPage::add_link |
( |
|
$rel, |
|
|
|
$href, |
|
|
|
$params = array() |
|
) |
| |
Add a new link
- Parameters
-
| string | $rel | the rel value |
| string | $href | the href value |
| array | $params | the other params |
- Returns
- void
◆ add_JSFile()
| HTMLPage::add_JSFile |
( |
|
$file = '' | ) |
|
Add a new Javascript file.
- Parameters
-
| string | $file | the file path & name |
- Returns
- void
◆ add_JSScript()
| HTMLPage::add_JSScript |
( |
|
$script = '', |
|
|
|
$unique = false |
|
) |
| |
Add a new Javascript script.
- Parameters
-
| string | $script | the script to add |
| boolean | $unique | this script has to be unique |
- Returns
- void
◆ add_JSPreScript()
| HTMLPage::add_JSPreScript |
( |
|
$script = '', |
|
|
|
$unique = false |
|
) |
| |
Add a new Javascript pre-script.
- Parameters
-
| string | $script | the script to add |
| boolean | $unique | this script has to be unique |
- Returns
- void
◆ add_JSWindowEventScript()
| HTMLPage::add_JSWindowEventScript |
( |
|
$event, |
|
|
|
$script, |
|
|
|
$unique = false |
|
) |
| |
Add a new Javascript script to window event script list.
- Parameters
-
| string | $event | the window event |
| string | $script | the script to add |
| boolean | $unique | this script has to be unique |
- Returns
- void
◆ add_JSloadScript()
| HTMLPage::add_JSloadScript |
( |
|
$script = '', |
|
|
|
$unique = false |
|
) |
| |
Add Javascript script on load window event.
- See also
- add_JSWindowEventScript()
- Parameters
-
| string | $script | the script to add |
| boolean | $unique | tell if this script must be unique |
- Returns
- void
◆ add_JSunloadScript()
| HTMLPage::add_JSunloadScript |
( |
|
$script = '', |
|
|
|
$unique = false |
|
) |
| |
Add Javascript script on unload window event.
- See also
- add_JSWindowEventScript()
- Parameters
-
| string | $script | the script to add |
| boolean | $unique | tell if this script must be unique |
- Returns
- void
◆ add_styleFile()
| HTMLPage::add_styleFile |
( |
|
$file = '', |
|
|
|
$media = '', |
|
|
|
$condition = '' |
|
) |
| |
Add CSS style file.
- Parameters
-
| string | $file | the file path & name |
| string | $media | the media which the style will be displayed |
| string | $condition | the media condition |
- Returns
- void
◆ add_styleScript()
| HTMLPage::add_styleScript |
( |
|
$css = '' | ) |
|
Add CSS style script.
- Parameters
-
| string | $css | the style script to add |
- Returns
- void
◆ add_styleIncludedFile()
| HTMLPage::add_styleIncludedFile |
( |
|
$file = '' | ) |
|
Add CSS style file to be inserted as script.
- Parameters
-
| string | $file | the file path & name |
- Returns
- void
◆ add_headerExtra()
| HTMLPage::add_headerExtra |
( |
|
$content = '' | ) |
|
Add extra content to header.
- Parameters
-
- Returns
- void
◆ add_RSSFeed()
| HTMLPage::add_RSSFeed |
( |
|
$url = '', |
|
|
|
$title = '' |
|
) |
| |
Add RSS feed.
- Parameters
-
| string | $url | the feed URL |
| string | $title | the feed title |
- Returns
- void
◆ set_redirect()
| HTMLPage::set_redirect |
( |
|
$time, |
|
|
|
$url |
|
) |
| |
Set a http redirection.
- Parameters
-
| int | $time | the time before redirection in second |
| string | $url | the target url |
- Returns
- void
◆ set_mobileMeta()
| HTMLPage::set_mobileMeta |
( |
|
$enabled = false, |
|
|
|
$config = array() |
|
) |
| |
Define mobile metas.
- Parameters
-
| boolean | $enabled | |
| array | $config | - Available parameters are
string width
string initial-scale
string maximum-scale
integer user-scalable
|
- Returns
- void
◆ add_structuredData()
| HTMLPage::add_structuredData |
( |
|
$data | ) |
|
Add JSON structured data to page.
- Parameters
-
- Returns
- void
◆ write_HTMLContent()
| HTMLPage::write_HTMLContent |
( |
|
$buffer = '' | ) |
|
Display builded content and re-initialise actual content.
- Parameters
-
| string | $buffer | the content to output |
- Returns
- void
◆ flush()
| HTMLPage::flush |
( |
|
$buffer = '' | ) |
|
Alias for write_HTMLContent method.
- See also
- write_HTMLContent()
- Parameters
-
| string | $buffer | the content to output |
- Returns
- void
◆ add_HTMLContent()
| HTMLPage::add_HTMLContent |
( |
|
$content = '' | ) |
|
Update content with given html content
- Parameters
-
- Returns
- void
◆ write_HTMLFile()
| HTMLPage::write_HTMLFile |
( |
|
$file = '', |
|
|
|
$buffer = '' |
|
) |
| |
Display built content updated with buffer value, then add a file content.
- Parameters
-
| string | $file | the file path & name |
| string | $buffer | the content to add |
- Returns
- string
◆ add_HTMLHeader()
| HTMLPage::add_HTMLHeader |
( |
| ) |
|
Write html page header.
- Returns
- void
◆ add_HTMLFooter()
| HTMLPage::add_HTMLFooter |
( |
| ) |
|
Write html page footer.
- Returns
- void
◆ get_doctype()
| HTMLPage::get_doctype |
( |
| ) |
|
Write page header doctype.
- Returns
- void
◆ get_htmlHeader()
| HTMLPage::get_htmlHeader |
( |
| ) |
|
Write page html header.
- Returns
- void
◆ get_title()
Write page title header.
- Returns
- void
◆ get_metas()
Write page header metas.
- Returns
- void
◆ get_links()
Write page header links.
- Returns
- void
◆ get_JSFiles()
| HTMLPage::get_JSFiles |
( |
| ) |
|
Write page jeader Javascript files
- Returns
- void
◆ get_JSPreScripts()
| HTMLPage::get_JSPreScripts |
( |
| ) |
|
Write Javascript pre-scripts.
- Returns
- void
◆ get_JSScripts()
| HTMLPage::get_JSScripts |
( |
| ) |
|
Write Javascript scripts
- Returns
- void
◆ get_styleFiles()
| HTMLPage::get_styleFiles |
( |
| ) |
|
Write style files.
- Returns
- void
◆ get_styleScripts()
| HTMLPage::get_styleScripts |
( |
| ) |
|
Write style scripts.
- Returns
- void
◆ get_headerExtras()
| HTMLPage::get_headerExtras |
( |
| ) |
|
write extra header data
- Returns
- void
◆ get_body()
Write body header.
- Returns
- void
◆ set_RSSFeed()
| HTMLPage::set_RSSFeed |
( |
|
$url = '', |
|
|
|
$title = '' |
|
) |
| |
Alias to add_RSSFeed.
- See also
- add_RSSFeed()
- Parameters
-
| string | $url | the rss url |
| string | $title | the rss title |
- Returns
- void
- Deprecated:
- Use add_RSSFeed instead.
◆ $content
| string HTMLPage::$content |
|
private |
◆ $doctype
| string HTMLPage::$doctype |
|
private |
◆ $htmlVersion
| integer HTMLPage::$htmlVersion |
|
private |
◆ $language
| string HTMLPage::$language |
|
private |
◆ $redirect_time
| int HTMLPage::$redirect_time = 0 |
|
private |
Page redirection delay in second.
◆ $redirect_url
| string HTMLPage::$redirect_url = '' |
|
private |
◆ $disable_cache
| boolean HTMLPage::$disable_cache = false |
|
private |
Is cache disabled for page.
◆ $site_title
| string HTMLPage::$site_title = '' |
|
private |
Site title for page header.
◆ $page_title
| string HTMLPage::$page_title = '' |
Content page title for page header.
◆ $charset
| string HTMLPage::$charset = "UTF-8" |
|
private |
◆ $metas
| array HTMLPage::$metas = array() |
|
private |
◆ $rss
| string HTMLPage::$rss = '' |
|
private |
◆ $robots_index
| boolean HTMLPage::$robots_index = true |
|
private |
Are robots allowed to index this page.
◆ $robots_follow
| boolean HTMLPage::$robots_follow = true |
|
private |
Are robots allowed to follow links in this page.
◆ $js_files
| array HTMLPage::$js_files = array() |
|
private |
Javascript files to be inserted.
◆ $js_scripts
| array HTMLPage::$js_scripts = array() |
|
private |
Javascript scripts to be inserted.
◆ $js_pre_scripts
| array HTMLPage::$js_pre_scripts = array() |
|
private |
Javascript scripts to be inserted before Javascript file insertion.
◆ $js_event_scripts
| array HTMLPage::$js_event_scripts = array() |
|
private |
Javascript scripts to be inserted on page events.
◆ $style_files
| array HTMLPage::$style_files = array() |
|
private |
CSS styles files to be inserted.
◆ $style_scripts
| array HTMLPage::$style_scripts = array() |
|
private |
CSS styles scripts to be inserted.
◆ $style_included_files
| array HTMLPage::$style_included_files = array() |
|
private |
CSS styles files to be inserted as script.
◆ $links
| array HTMLPage::$links = array() |
|
private |
◆ $google_analytics
| array HTMLPage::$google_analytics = array('code'=>'', 'domain'=>'auto') |
|
private |
Google analytics information to be inserted in page.
◆ $header_extras
| string HTMLPage::$header_extras = '' |
|
private |
◆ $favicon
| string HTMLPage::$favicon = '' |
|
private |
URL of personalised favicon.
◆ $bodyClass
| string HTMLPage::$bodyClass = '' |
|
private |
◆ $structuredData
| array HTMLPage::$structuredData = array() |
|
private |
JSON structured data for search engines.
The documentation for this class was generated from the following file: