The model name for which the form is being defined. Should include the plugin name for plugin models. e.g. ContactManager.Contact. If an array is passed and $options argument is empty, the array will be used as options. If false, no model is used.
An array of html attributes and options. Possible options are type, action, url, default, onsubmit, inputDefaults, encoding.
Returns
A formatted opening FORM tag.
Description
Returns an HTML FORM element.
选项和 HTML 属性数组
返回
HTML 按钮标签。
描述
创建 标签。 type 属性默认为
type="submit"
。您可以使用
Syntax
file(string $fieldName, array $optionsarray() )
Parameters
Name of a field, in the form "Modelname.fieldname"
Array of HTML attributes.
Returns
A generated file input.
Description
Creates file input widget.
$options['type'].
将其更改为不同的值
表>
以下函数用于在 HTML 页面上生成复选框。
语法
复选框(字符串$fieldName,数组$optionsarray())
参数
字段名称,例如“Modelname.fieldname”
HTML 属性数组。可能的选项有 value、checked、hiddenField、disabled、default。
The label appearing on the button OR if string contains :// or the extension .jpg, .jpe, .jpeg, .gif, .png. Use an image if the extension exists, AND the first character is /, image is relative to webroot, OR if the first character is not /, image is relative to webroot/img.
Array of options. Possible options are div, before, after, type etc.
Returns
An HTML submit button
Description
Creates a submit button element. This method will generate elements that can be used to submit, and reset forms by using $options. Image submits can be created by supplying an image path for $caption.
<?php namespace App\Controller;
use App\Controller\AppController;
class RegistrationsController extends AppController{
public function index(){
$country = array('India','United State of America','United Kingdom');
$this->set('country',$country);
$gender = array('Male','Female');
$this->set('gender',$gender);
}
}
?>