Exemple #1
0
 /**
  *  get the form's name, this is basically the namespace the form is using
  *  
  *  @return string
  */
 public function getName()
 {
     if (!$this->hasName()) {
         $rthis = new ReflectionObject($this);
         $this->setName($rthis->getShortName());
     }
     //if
     return parent::getName();
 }
Exemple #2
0
 /**
  *  override parent to do Field specific things
  *  
  *  @see  parent::renderAttr()
  */
 public function renderAttr(array $attr_map = array())
 {
     $name = isset($attr_map['name']) ? $attr_map['name'] : $this->getName();
     $name_map = $this->getNameInfo($name);
     $attr_map['name'] = $name_map['form_name'];
     if (!$this->hasId()) {
         $prefix = $this->hasForm() ? $this->getForm()->getName() : '';
         $attr_map['id'] = $this->getRandomId($prefix);
     }
     //if
     return parent::renderAttr($attr_map);
 }