Example #1
0
 public function image($src, array $htmlOptions = array())
 {
     if (!isset($htmlOptions['alt'])) {
         $htmlOptions['alt'] = $src;
     }
     $tag = new Joeh_Template_Tag('img');
     $tag->src = $this->imagePath($src);
     $tag->addAttributesFromArray($htmlOptions);
     return $tag->toHTML();
 }
Example #2
0
 private function input($type, $name, $value = null, array $htmlOptions = array())
 {
     $genId = true;
     if (isset($htmlOptions['id']) && $htmlOptions['id'] === false) {
         $genId = false;
     }
     $input = new Joeh_Template_Tag('input');
     $input->addAttributesFromArray($htmlOptions);
     $input->type = $type;
     if (!empty($name)) {
         $input->name = $name;
         if ($genId) {
             $input->id = $name;
         }
     }
     $input->value = $value;
     return $input->toHTML() . PHP_EOL;
 }