blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Base  /  Customcss   Login nu   Login
blank.gif
 ««« Se kilde koden
blank.gif
triangle.gif Basic Base  Component Db Dto Form Form-elements Jquery Layout Menu Menu-fisheye Mvc Tab Table Template Util
blank.gif
blank.gif
 
arrow-headline.gif Index
 
  Tilbage

Navn : CustomCss.php


Sample code, tutorial

Sådan benyttes komponenten CustomCss klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

  • <?
    require_once(HTML_PACKAGE_PATH.'/CustomCss.php');
    ?>

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

  • <?
    CustomCss
    ::display($param1, $param2, $param3, ...);
    ?>

eller du kan lave en instance af komponenten og benytte metoderne direkte:

  • <?
    $object
    = new CustomCss($param1, $param2, $param3, ...);
    print
    $object->getHtml();
    ?>

Parent html

Sådan vises komponenten CustomCss klassen


PHP source code

Den fulde PHP kildekode for CustomCss klassen

<?
/**
* @package base
* @see HTML_BASE_PAGE_PATH.'/CssBase.php'
* @copyright (c) http://Finn-Rasmussen.com
* @license http://Finn-Rasmussen.com/license/ myPHP License conditions
* @author http://Finn-Rasmussen.com
* @version 1.10
* @since 22-feb-2007
*/

/**
* Includes a Custom Css file
* <code>
* Usage:
*   $object = new CustomCss($href,$title);
*   print $object->getHtml();
* Or:
*   CustomCss::display($href,$title);
* </code>
* @package base
*/
class CustomCss extends Html {
    var
$href  = '';
    var
$title = '';
    
   
/**
    * Constructor
    * @param String $href  The href to the custom css files
    * @param String $title The title of the link tag
    */
    
function CustomCss($href='',$title='') {
        
$this->Html();
        
$this->href  = $href !=''?$href :CUSTOM_CSS_HREF_1;
        
$this->title = $title!=''?$title:CUSTOM_CSS_TITLE_1;
    }
    
   
/**
    * Returns the html for the Custom CSS
    * @return String the complete html
    */
    
function getHtml() {
        
$html = '';
        if (
$this->href!='') {
           
$html .= '<link rel="STYLESHEET" type="text/css"';
           
$html .= $this->getAttribute('href');
           
$html .= $this->getAttribute('title');
           
$html .= " />\r\n";
        }
        return
$html;
    }
    
   
/**
    * Display html
    * <code>
    * Usage:
    *    CustomCss::display($href,$title);
    * </code>
    * @static
    * @param String $href  The href to the custom css files
    * @param String $title The title of the link tag
    */
   
function display($href='',$title='') {
      
$html = new CustomCss($href,$title);
      
$html->addHtml();
   }
}
?>

HTML source code

Den fulde HTML kildekode for CustomCss klassen

<?

?>

Class methods

Her er 'klasse metoderne' for CustomCss klassen:

  • object
  • getclassname
  • getmsg
  • addhtml
  • gethtml
  • tostring
  • getcachefilename
  • save
  • content
  • html
  • setobject
  • set
  • get
  • getattribute
  • gettag
  • add
  • getsizeof
  • getelement
  • getelements
  • gettoogle
  • getmaximize
  • getminimize
  • newtriangle
  • display
  • showsource
  • customcss

Object vars

Her er 'objekt variable' for CustomCss klassen:

  • html =>
  • sql =>
  • elements => Array
  • sizeof => 0
  • href =>
  • title =>

 
triangle.gif

danmark

Germany

England

France

Italy

Norge

Sverige

USA


 
blank.gif