generateHtmlName() публичный статический метод

Converts control name to HTML name.
public static generateHtmlName ( $id ) : string
Результат string
Пример #1
0
 /**
  * @return Nette\Utils\Html
  */
 public function getStateControlPart()
 {
     $countryCode = $this->countryCode ?: $this->defaultCountryCode;
     $items = $this->getStates($countryCode);
     $disabled = $this->isDisabled();
     // Disabled ?
     if ($items === NULL && count($items) === 0) {
         $disabled = TRUE;
     }
     if ($items === NULL) {
         $items = array(NULL => 'without state');
     }
     /** @var Nette\Utils\Html $states */
     $states = Nette\Forms\Helpers::createSelectBox($items, array('selected?' => $this->stateCode));
     // Set attributes
     $states->addAttributes(parent::getControl()->attrs);
     $states->attrs['id'] = $this->getHtmlId() . '_states';
     $states->attrs['name'] = Nette\Forms\Helpers::generateHtmlName($this->lookupPath('Nette\\Forms\\Form') . '_states');
     if ($disabled) {
         $states->attrs['disabled'] = TRUE;
     }
     return $states;
 }
Пример #2
0
 /**
  * Returns HTML name of control.
  * @return string
  */
 public function getHtmlName()
 {
     return Nette\Forms\Helpers::generateHtmlName($this->lookupPath('Nette\\Forms\\Form'));
 }