TYPO3 CMS  TYPO3_6-2
ButtonViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script belongs to the FLOW3 package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
36 
40  protected $tagName = 'button';
41 
48  public function initializeArguments() {
49  parent::initializeArguments();
50  $this->registerTagAttribute('autofocus', 'string', 'Specifies that a button should automatically get focus when the page loads');
51  $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads');
52  $this->registerTagAttribute('form', 'string', 'Specifies one or more forms the button belongs to');
53  $this->registerTagAttribute('formaction', 'string', 'Specifies where to send the form-data when a form is submitted. Only for type="submit"');
54  $this->registerTagAttribute('formenctype', 'string', 'Specifies how form-data should be encoded before sending it to a server. Only for type="submit" (e.g. "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain")');
55  $this->registerTagAttribute('formmethod', 'string', 'Specifies how to send the form-data (which HTTP method to use). Only for type="submit" (e.g. "get" or "post")');
56  $this->registerTagAttribute('formnovalidate', 'string', 'Specifies that the form-data should not be validated on submission. Only for type="submit"');
57  $this->registerTagAttribute('formtarget', 'string', 'Specifies where to display the response after submitting the form. Only for type="submit" (e.g. "_blank", "_self", "_parent", "_top", "framename")');
59  }
60 
68  public function render($type = 'submit') {
69  $name = $this->getName();
71 
72  $this->tag->addAttribute('type', $type);
73  $this->tag->addAttribute('name', $name);
74  $this->tag->addAttribute('value', $this->getValue());
75  $this->tag->setContent($this->renderChildren());
76 
77  return $this->tag->render();
78  }
79 }
registerTagAttribute($name, $type, $description, $required=FALSE, $default=NULL)