示例#1
0
文件: Form.php 项目: Jaymon/Montage
 /**
  *  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();
 }
示例#2
0
文件: Field.php 项目: Jaymon/Montage
 /**
  *  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);
 }