Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17211 программистов и 1835 роботов. Сейчас ищут 1598 программистов ...

Headers

Вернуться к: HTML_Page2

Headers

Headers – Setting title and other meta data

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

<?php
$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');
?>


Вернуться к: HTML_Page2

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware