本文整理汇总了PHP中Zend_Form_SubForm::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_SubForm::getName方法的具体用法?PHP Zend_Form_SubForm::getName怎么用?PHP Zend_Form_SubForm::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_SubForm
的用法示例。
在下文中一共展示了Zend_Form_SubForm::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isStored
/**
* Method check subform data is storage
*
* @param Zend_Form_SubForm|string $subForm
* @return bool
*/
public function isStored($subForm)
{
if ($subForm instanceof Zend_Form_SubForm) {
$key = $subForm->getName();
} else {
$key = $subForm;
}
return $this->getSessionNamespace()->{$key} ? true : false;
}
示例2: subFormIsValid
public function subFormIsValid(Zend_Form_SubForm $subForm, array $data)
{
$name = $subForm->getName();
if ($subForm->isValid($data)) {
$this->getSessionNamespace()->{$name} = $subForm->getValues();
return true;
}
return false;
}
示例3: addressSource
/**
* Insert radio buttons to activate data copy if checked. <br />
* Depending on the radio checked, the address used will be extracted from
* the profile or from a temporary table or empty.
*
* @param Zend_Form_SubForm $addressSubForm The subForm containing the
* address fields to duplicate.
* @param Array $options Options to defined the radio buttons.
*
* @return void
*/
public function addressSource($addressSubForm, $options = array())
{
if ($addressSubForm instanceof Zend_Form_SubForm || $addressSubForm instanceof Cible_Form_SubForm) {
$name = $this->_parentForm . $addressSubForm->getName();
if (empty($name)) {
throw new Exception('Please, set this subform name in order to add the checkbox to duplicate address.');
}
$addrSource = new Zend_Form_Element_Radio('addrSource');
$addrSource->addMultiOptions($options['choices']);
$addrSource->setValue($options['default']);
$addrSource->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'addrSource label_after_checkbox'))));
$this->_form->addElement($addrSource);
$this->_addJsActions($name . '-addrSource', 'addrSource');
} else {
throw new Exception('The parameter is not an instance of Zend_Form_SubForm or Cible_form_SubForm');
}
}