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);
}
}
?>