PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Leandro Antonello  >  Page Header  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example of usage
Class: Page Header
Generate HTTP response and HTML page headers
Author: By
Last change: New way to use the updated class
Date: 10 years ago
Size: 1,059 bytes


Class file image Download

// Get reference to the PageHeader Singleton instance
$header = PageHeader::getInstance();

// Adds the page title and defaults headers to prevent cache.
$header->setTitle(".:: PageHeader Example ::.");

// Adds description, keywords and robots
$header->Description = "Site description here";
$header->Keywords = "site, website, keywords";
$header->addRobot('robots', 'index, follow');
$header->addRobot('googlebot', 'noodp');
$header->addRobot('msnbot', 'noodp');
$header->addRobot('slurp', 'noydir');

// Can defines a Favorite Icon too
//$header->Favicon = 'favicon.ico';

// Adds a CSS file that will be cacheable. Can use the alias addCss()
$header->addStyle('css/styles.css', TRUE);

// Adds a javascript file thats NOT will be chacheable. Can use the alias addJs()
$header->addScript('js/jquery-1.4.2.min.js', FALSE);

// Write down the entire header.
    View source to inspect page header or use Firebug.

For more information send a message to info at phpclasses dot org.