public function initializeArguments() { parent::initializeArguments(); $this->registerTagAttribute('class', 'string', 'class of input field'); $this->registerArgument('route', 'string', 'route to be used'); $this->registerArgument('arguments', 'array', 'arguments used for the route replacements', FALSE, array()); }
public function initializeArguments() { parent::initializeArguments(); $this->registerTagAttribute('size', 'string', 'Size of input field'); $this->registerTagAttribute('name', 'string', 'Name of input field'); $this->registerTagAttribute('class', 'string', 'class of input field'); $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads'); $this->registerArgument('optionValueField', 'string', 'If specified, will call the appropriate getter on each object to determine the value.'); $this->registerArgument('optionLabelField', 'string', 'If specified, will call the appropriate getter on each object to determine the label.'); $this->registerArgument('options', 'mixed', 'Associative array or object with internal IDs as key, and the values are displayed in the select box', true); $this->registerArgument('value', 'mixed', 'The default value'); }
/** * Handles additional arguments, sorting out any data- * prefixed tag attributes and assigning them. Then passes * the unassigned arguments to the parent class' method, * which in the default implementation will throw an error * about "undeclared argument used". * * @param array $arguments * @return void */ public function handleAdditionalArguments(array $arguments) { $unassigned = array(); foreach ($arguments as $argumentName => $argumentValue) { if (strpos($argumentName, 'data-') === 0) { $this->tag->addAttribute($argumentName, $argumentValue); } else { $unassigned[$argumentName] = $argumentValue; } } parent::handleAdditionalArguments($unassigned); }