Apply a new stylesheet

Overview

Generate phpinfo() style PEAR information (PEAR install with package list from pear.php.net channel) with a blue skin.

Screenshot

blue skin with package full detailed

...

Dependencies

This example requires mandatory resources :

Explains step by step

Its almost the same as previous basic example. We just add a new CSS (stylesheet) file reference at line 23.

Default stylesheet (green skin), used as pattern, is located into (data_dir)\PEAR_Info directory.

Where (data_dir) stand for result of "pear config-get data_dir" command.

Source Code

PHP code
  1. <?php
  2. /**
  3.  * Generate phpinfo() style PEAR information, with a custom blue skin
  4.  *
  5.  * PHP versions 4 and 5
  6.  *
  7.  * @category PEAR
  8.  * @package  PEAR_Info
  9.  * @author   Laurent Laville <pear@laurent-laville.org>
  10.  * @license  http://www.php.net/license/3_01.txt  PHP License 3.01
  11.  * @version  CVS: $Id: pear_info2.php,v 1.2 2007/12/15 16:27:23 farell Exp $
  12.  * @link     http://pear.php.net/package/PEAR_Info
  13.  * @ignore
  14.  */
  15.  
  16. // require the PEAR_Info file
  17. require_once 'PEAR/Info.php';
  18.  
  19. // Create PEAR_Info object
  20. $info = new PEAR_Info();
  21.  
  22. // set your own styles, rather than use the default stylesheet
  23. $info->setStyleSheet(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'blueskin.css');
  24.  
  25. // Display PEAR_Info output
  26. $info->display();
  27. ?>
generated by Generic Syntax Highlighter - GeSHi