예제 #1
0
 public function __construct($src, $attributes = array())
 {
     parent::__construct();
     // Store the Image Source:
     $this->src = $src;
     // Trying something different: I wanted the user to be able to assign various
     // parameters only when necessary. To this end, I am allowing the user to pass
     // in am array of '$attributes' which will be processed accordingly.
     if (is_array($attributes)) {
         // Iterate through attributes:
         foreach ($attributes as $key => $val) {
             if ($key == 'class') {
                 $classes = explode(" ", $val);
                 // Set the css selector class(es) (<tag class="one two three">
                 $this->addClasses($classes);
             } elseif ($key == 'id') {
                 $this->setID($val);
                 // Set the css selector ID (<tag id="">
             } else {
                 $this->{$key} = $val;
                 // Set the value for the specified $key. Note: Won't work for un-accommodated attributes.
             }
         }
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #2
0
 public function __construct($css)
 {
     parent::__construct();
     $this->css = $css;
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #3
0
 public function __construct($title = '')
 {
     parent::__construct();
     $this->title = $title;
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #4
0
 public function __construct($content = "", $href = "")
 {
     parent::__construct();
     $this->content = $content;
     $this->href = $href;
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #5
0
 public function __construct($rel = '', $type = '', $href = '')
 {
     parent::__construct();
     $this->rel = $rel;
     $this->type = $type;
     $this->href = $href;
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #6
0
 /**
  * Creates and populates the initial tag information.
  * 
  * @param constant $doctype
  * @param Array $children
  * @param Array $attributes
  * 
  */
 public function __construct($doctype = null, $children = null, $attributes = null)
 {
     parent::__construct();
     // Set the doctype, if any:
     if (!is_null($doctype)) {
         $this->doctype = $doctype;
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #7
0
 public function __construct($css_id = '', $classes = array())
 {
     parent::__construct();
     if (trim($css_id) != '') {
         $this->setID($css_id);
     }
     if (is_array($classes) && count($classes) > 0) {
         $this->addClasses($classes);
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
 public function __construct($src = '', $script = '')
 {
     parent::__construct();
     // Designed to accommodat EITHER $src OR $script:
     if (strlen(trim($src)) > 0) {
         $this->type = 'source';
         $this->src = $src;
     } elseif (strlen(trim($script))) {
         $this->type = 'script';
         $this->script = $script;
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #9
0
 public function __construct($name = '', $http_equiv = '', $content = '')
 {
     parent::__construct();
     // Designed to accommodat EITHER name, or $http-equiv:
     if (strlen(trim($name)) > 0) {
         $this->type = 'name';
         $this->name = $name;
         $this->content = $content;
     } elseif (strlen(trim($http_equiv))) {
         $this->type = 'http-equiv';
         $this->http_equiv = $http_equiv;
         $this->content = $content;
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #10
0
 public function __construct($type = null, $start = null, $reversed = false)
 {
     parent::__construct();
     // Validate $type:
     if (in_array($type, array("1", "A", "a", "I", "i"))) {
         $this->type = $type;
     }
     // Validate $start:
     if (is_numeric($start)) {
         $this->start = $start;
     }
     // Validate $reversed:
     if ($reversed === true) {
         $this->reversed = true;
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #11
0
 public function __construct($css_id = '', $classes = array(), $attributes = array())
 {
     parent::__construct();
     // CSS ID:
     if (trim($css_id) != '') {
         $this->setID($css_id);
     }
     // Classes:
     if (is_array($classes) && count($classes) > 0) {
         $this->addClasses($classes);
     }
     // Check for additional attributes:
     foreach ($attributes as $attr => $val) {
         if (isset($this->{$attr})) {
             $this->{$attr} = $val;
         }
     }
     // Return the unique identifier for this object:
     return $this->id;
 }
예제 #12
0
 public function __construct($href = null, $target = null)
 {
     parent::__construct();
     $this->href = $href;
     $this->target = $target;
 }