CaMykS  1.0-20231201
Public Member Functions | Public Attributes | Private Attributes | List of all members
HTMLPage Class Reference

HTML page object. More...

Public Member Functions

 __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='')
 

Public Attributes

 $page_title = ''
 Content page title for page header. More...
 

Private Attributes

 $content
 Page content. More...
 
 $doctype
 Page doctype. More...
 
 $htmlVersion
 HTML version for page. More...
 
 $language
 Page current language. More...
 
 $redirect_time = 0
 Page redirection delay in second. More...
 
 $redirect_url = ''
 Page redirection URL. More...
 
 $disable_cache = false
 Is cache disabled for page. More...
 
 $site_title = ''
 Site title for page header. More...
 
 $charset = "UTF-8"
 Page charset header. More...
 
 $metas = array()
 Page metas header. More...
 
 $rss = ''
 RSS URL for page header. More...
 
 $robots_index = true
 Are robots allowed to index this page. More...
 
 $robots_follow = true
 Are robots allowed to follow links in this page. More...
 
 $js_files = array()
 Javascript files to be inserted. More...
 
 $js_scripts = array()
 Javascript scripts to be inserted. More...
 
 $js_pre_scripts = array()
 Javascript scripts to be inserted before Javascript file insertion. More...
 
 $js_event_scripts = array()
 Javascript scripts to be inserted on page events. More...
 
 $style_files = array()
 CSS styles files to be inserted. More...
 
 $style_scripts = array()
 CSS styles scripts to be inserted. More...
 
 $style_included_files = array()
 CSS styles files to be inserted as script. More...
 
 $links = array()
 Header links for page. More...
 
 $google_analytics = array('code'=>'', 'domain'=>'auto')
 Google analytics information to be inserted in page. More...
 
 $header_extras = ''
 Page extra headers. More...
 
 $favicon = ''
 URL of personalised favicon. More...
 
 $bodyClass = ''
 HTML body tag to apply. More...
 
 $structuredData = array()
 JSON structured data for search engines. More...
 

Detailed Description

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
Date
Creation: Jun 2005
Modification: Nov 2020
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.

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Constructor & Destructor Documentation

◆ __construct()

HTMLPage::__construct ( )

Class constructor.

Returns
void

Member Function Documentation

◆ set_siteInformations()

HTMLPage::set_siteInformations (   $site_title,
  $site_author = '' 
)

Define site information.

Parameters
string$site_titlethe website title
string$site_authorthe website author
Returns
void

◆ set_pageInformations()

HTMLPage::set_pageInformations (   $page_title,
  $page_desc = '',
  $page_keys = '',
  $page_lang = '' 
)

Define page information.

Parameters
string$page_titlethe webpage title
string$page_descthe webpage description meta
string$page_keysthe webpage keywords meta
string$page_langthe webpage language displayed
Returns
void

◆ set_robotInformations()

HTMLPage::set_robotInformations (   $index = true,
  $follow = true 
)

Define robots information.

Parameters
boolean$indexthe index value
boolean$followthe follow value
Returns
void

◆ set_googleInformations()

HTMLPage::set_googleInformations (   $code = '',
  $domain = '' 
)

Define google information.

Parameters
string$codethe google code value
string$domainthe google domain value
Returns
void

◆ set_favicon()

HTMLPage::set_favicon (   $favicon = null)

Define site favicon.

Parameters
string$faviconthe favicon file name
Returns
void

◆ set_charset()

HTMLPage::set_charset (   $charset = '')

Define charset.

Parameters
string$charset
Returns
void

◆ set_bodyClass()

HTMLPage::set_bodyClass (   $class = '')

Define body class.

Parameters
string$class
Returns
void

◆ add_meta()

HTMLPage::add_meta (   $key,
  $value,
  $method = 'name' 
)

Add a new meta.

Parameters
string$keythe meta name
string$valuethe meta value
string$methodthe meta displaying method
Returns
void

◆ add_link()

HTMLPage::add_link (   $rel,
  $href,
  $params = array() 
)

Add a new link

Parameters
string$relthe rel value
string$hrefthe href value
array$paramsthe other params
Returns
void

◆ add_JSFile()

HTMLPage::add_JSFile (   $file = '')

Add a new Javascript file.

Parameters
string$filethe file path & name
Returns
void

◆ add_JSScript()

HTMLPage::add_JSScript (   $script = '',
  $unique = false 
)

Add a new Javascript script.

Parameters
string$scriptthe script to add
boolean$uniquethis script has to be unique
Returns
void

◆ add_JSPreScript()

HTMLPage::add_JSPreScript (   $script = '',
  $unique = false 
)

Add a new Javascript pre-script.

Parameters
string$scriptthe script to add
boolean$uniquethis 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$eventthe window event
string$scriptthe script to add
boolean$uniquethis 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$scriptthe script to add
boolean$uniquetell 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$scriptthe script to add
boolean$uniquetell if this script must be unique
Returns
void

◆ add_styleFile()

HTMLPage::add_styleFile (   $file = '',
  $media = '',
  $condition = '' 
)

Add CSS style file.

Parameters
string$filethe file path & name
string$mediathe media which the style will be displayed
string$conditionthe media condition
Returns
void

◆ add_styleScript()

HTMLPage::add_styleScript (   $css = '')

Add CSS style script.

Parameters
string$cssthe style script to add
Returns
void

◆ add_styleIncludedFile()

HTMLPage::add_styleIncludedFile (   $file = '')

Add CSS style file to be inserted as script.

Parameters
string$filethe file path & name
Returns
void

◆ add_headerExtra()

HTMLPage::add_headerExtra (   $content = '')

Add extra content to header.

Parameters
string$content
Returns
void

◆ add_RSSFeed()

HTMLPage::add_RSSFeed (   $url = '',
  $title = '' 
)

Add RSS feed.

Parameters
string$urlthe feed URL
string$titlethe feed title
Returns
void

◆ set_redirect()

HTMLPage::set_redirect (   $time,
  $url 
)

Set a http redirection.

Parameters
int$timethe time before redirection in second
string$urlthe 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
array$data
Returns
void

◆ write_HTMLContent()

HTMLPage::write_HTMLContent (   $buffer = '')

Display builded content and re-initialise actual content.

Parameters
string$bufferthe content to output
Returns
void

◆ flush()

HTMLPage::flush (   $buffer = '')

Alias for write_HTMLContent method.

See also
write_HTMLContent()
Parameters
string$bufferthe content to output
Returns
void

◆ add_HTMLContent()

HTMLPage::add_HTMLContent (   $content = '')

Update content with given html content

Parameters
string$content
Returns
void

◆ write_HTMLFile()

HTMLPage::write_HTMLFile (   $file = '',
  $buffer = '' 
)

Display built content updated with buffer value, then add a file content.

Parameters
string$filethe file path & name
string$bufferthe 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()

HTMLPage::get_title ( )

Write page title header.

Returns
void

◆ get_metas()

HTMLPage::get_metas ( )

Write page header metas.

Returns
void

◆ get_links()

HTMLPage::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()

HTMLPage::get_body ( )

Write body header.

Returns
void

◆ set_RSSFeed()

HTMLPage::set_RSSFeed (   $url = '',
  $title = '' 
)

Alias to add_RSSFeed.

See also
add_RSSFeed()
Parameters
string$urlthe rss url
string$titlethe rss title
Returns
void
Deprecated:
Use add_RSSFeed instead.

Member Data Documentation

◆ $content

string HTMLPage::$content
private

Page content.

◆ $doctype

string HTMLPage::$doctype
private

Page doctype.

◆ $htmlVersion

integer HTMLPage::$htmlVersion
private

HTML version for page.

◆ $language

string HTMLPage::$language
private

Page current language.

◆ $redirect_time

int HTMLPage::$redirect_time = 0
private

Page redirection delay in second.

◆ $redirect_url

string HTMLPage::$redirect_url = ''
private

Page redirection URL.

◆ $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

Page charset header.

◆ $metas

array HTMLPage::$metas = array()
private

Page metas header.

◆ $rss

string HTMLPage::$rss = ''
private

RSS URL for page header.

◆ $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

Header links for page.

◆ $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

Page extra headers.

◆ $favicon

string HTMLPage::$favicon = ''
private

URL of personalised favicon.

◆ $bodyClass

string HTMLPage::$bodyClass = ''
private

HTML body tag to apply.

◆ $structuredData

array HTMLPage::$structuredData = array()
private

JSON structured data for search engines.


The documentation for this class was generated from the following file: