cakephp-2.0 > FormHelper :: input()
A AbstractTransport AclBehavior AclComponent AclInterface AclNode AclShell Aco AcoAction ActionsAuthorize ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel AppShell Aro AuthComponent B BadRequestException BakeShell BakeTask BaseAuthenticate BaseAuthorize BasicAuthenticate BasicAuthentication BehaviorCollection C Cache CacheEngine CacheException CacheHelper CacheSession CakeEmail CakeErrorController CakeException CakeLog CakeLogException CakeLogInterface CakePlugin CakeRequest CakeResponse CakeRoute CakeSchema CakeSession CakeSessionException CakeSessionHandlerInterface CakeSocket ClassRegistry CommandListShell Component ComponentCollection ConfigReaderInterface Configure ConfigureException ConnectionManager ConsoleErrorHandler ConsoleException ConsoleInput ConsoleInputArgument ConsoleInputOption ConsoleInputSubcommand ConsoleOptionParser ConsoleOutput ConsoleShell ContainableBehavior Controller ControllerAuthorize ControllerTask CookieComponent CrudAuthorize D DatabaseSession DataSource DbAcl DbAclSchema DbConfigTask DboSource Debugger DebugTransport DigestAuthenticate DigestAuthentication Dispatcher E EmailComponent ErrorHandler ExceptionRenderer ExtractTask F File FileEngine FileLog FixtureTask Folder ForbiddenException FormAuthenticate FormHelper H Helper HelperCollection HelpFormatter HtmlHelper HttpException HttpResponse HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniReader InternalErrorException J JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MailTransport MediaView MemcacheEngine MethodNotAllowedException MissingActionException MissingBehaviorException MissingComponentException MissingConnectionException MissingControllerException MissingDatabaseException MissingDatasourceConfigException MissingDatasourceException MissingHelperException MissingLayoutException MissingModelException MissingPluginException MissingShellException MissingShellMethodException MissingTableException MissingTaskException MissingTestLoaderException MissingViewException Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte Mysql N NotFoundException NumberHelper O Object ObjectCollection P PagesController PagesController PaginatorComponent PaginatorHelper Permission PhpReader PluginShortRoute PluginTask Postgres PrivateActionException ProjectTask PrototypeEngineHelper R RedirectRoute RequestHandlerComponent Router RouterException RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher SmtpTransport SocketException Sqlite Sqlserver String T TaskCollection TemplateTask TestsuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior U UnauthorizedException UpgradeShell V Validation View ViewTask W WincacheEngine X XcacheEngine Xml XmlException

input

line:946 at /lib/Cake/View/Helper/FormHelper.php
Generates a form input element complete with label and wrapper div

Method

(string) public input ($fieldName, $options = array())

Parameters

ParameterTypeCommentDefault
$fieldName string required This should be "Modelname.fieldname"
$options array optional Each type of input takes different options. array()

Return

string

Comment

Generates a form input element complete with label and wrapper div

### Options

See each field type method for more information. Any options that are part of
$attributes or $options for the different **type** methods can be included in `$options` for input().i
Additionally, any unknown keys that are not in the list below, or part of the selected type's options
will be treated as a regular html attribute for the generated input.

- `type` - Force the type of widget you want. e.g. `type => 'select'`
- `label` - Either a string label, or an array of options for the label. See FormHelper::label()
- `div` - Either `false` to disable the div, or an array of options for the div.
See HtmlHelper::div() for more options.
- `options` - for widgets that take options e.g. radio, select
- `error` - control the error message that is produced
- `empty` - String or boolean to enable empty select box options.
- `before` - Content to place before the label + input.
- `after` - Content to place after the label + input.
- `between` - Content to place between the label + input.
- `format` - format template for element order. Any element that is not in the array, will not be in the output.
- Default input format order: array('before', 'label', 'between', 'input', 'after', 'error')
- Default checkbox format order: array('before', 'input', 'between', 'label', 'after', 'error')
- Hidden input will not be formatted
- Radio buttons cannot have the order of input and label elements controlled with these settings.

@param string $fieldName This should be "Modelname.fieldname"
@param array $options Each type of input takes different options.
@return string Completed form widget.
@link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#creating-form-elements