Home
Accueil
Downloads
Téléchargements
Forums
Forums
Your Account
Votre compte
Menu
· Accueil ·

· Communication ·
  · Forums
  · Messages privés
  · Contactez nous
  · Recommendez nous
  · Sondages
  · Les projets

· Nouvelles ·Stats
  · Sujets
  · Ecrire un article
  · Articles archivés
  · Articles RSS
  · Lettre de sécurité
  · Archive de lettres

· Téléchargements ·
  · Accueil
  · Nouveautés
  · Mises à jour
  · Thêmes

· Outils ·
  · Outils divers
  · Convertisseur de temps
  · Table de caractères
  · Générateur de boutons
  · Compresseur Javascript

· Documentation ·
  · Wiki
  · Questions/Réponses
  · Documents
  · Manuel PHP-Nuke
  · Manuel PHP
  · Manuel PEAR
  · Encyclopédies

· Liens ·
  · Nos liens
  · Nos fluxs RSS
  · Partenaires
  · Votre publicité
  · Sitemap
  · Mes bannières

· Infos ·
  · Rechercher
  · Votre compte
  · Liste des membres
  · Carte des membres
  · Top

· Divers ·
  · Météo
  · Galeries
  · Statistiques Phpnuke
  · MS Analysis


Headers

Headers

Headers -- Setting title and other meta data

Setting headers

The method you surely will use is setTitle() that sets the title of the page; the one that your browser displays in its title/window bar.

<?php
$page->setTitle('My first HTML page');
?>

Meta tags can be set with setMetaData() which takes two parameters, the tag name and the content.

<?php
$page->setMetaData('author', 'Christian Weiske');
?>

A link to a bookmark icon (favicon) can be set using addFavicon() .

Links to related pages (previous, next, home etc.) are added with addHeadLink() - the first parameter determines the URL, the second the relation.

<?php
$page->addHeadLink('home.htm', 'Start');
?>

Adding CSS - Cascading stylesheets

A HTML page may contain two types of stylesheets: Inline css and a link to external .css file.

Inline CSS declarations are made with addStyleDeclaration()

$page->addStyleDeclaration('
div.block {
    border: 1px solid #000;
}
');

Links to external CSS files are created by using addStyleSheet(). The optional third parameter determines which media type the stylesheet shall be used for.

<?php
$page->addStyleSheet('css/dark.css');
$page->addStyleSheet('css/print.css', 'text/css', 'print');
?>

Adding scripts

You may want to add some javascript code to your page; either inline or link to an external .js file.

Inline code blocks are added with addScriptDeclaration() . The optional second parameter defaults to text/javascript but can be changed as needed.

<?php
$page->addScriptDeclaration('
function javaScriptTest() {
    alert("Test");
}
');
?>

Links to external script files are created by using addScript().

<?php
$page->addScript('js/functions.js');
?>

Manuel PEAR pour PHP-Nuke © www.stefvar.com
Syndiquez notre contenu RSS, Atom, etc..
PHP-Nuke © 2007Reproduction interdite sans autorisation de ma part www.stefvar.com Copyright © 2008Thème iCGstation
Site français de la communauté PragmaMx