From d26c05be875c376b6ca1519c332a66b1867c4680 Mon Sep 17 00:00:00 2001 From: Koji Tanaka Date: Sun, 5 Mar 2017 20:55:38 +0900 Subject: [PATCH] Replaced FormHelper's "input" with "control" throughout the document. --- en/core-libraries/form.rst | 6 +++--- en/elasticsearch.rst | 4 ++-- en/orm/behaviors/translate.rst | 10 +++++----- en/orm/behaviors/tree.rst | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/en/core-libraries/form.rst b/en/core-libraries/form.rst index 890f4ab635..e3842065ef 100644 --- a/en/core-libraries/form.rst +++ b/en/core-libraries/form.rst @@ -186,9 +186,9 @@ Once you've created a Form class, you'll likely want to create an HTML form for it. FormHelper understands Form objects just like ORM entities:: echo $this->Form->create($contact); - echo $this->Form->input('name'); - echo $this->Form->input('email'); - echo $this->Form->input('body'); + echo $this->Form->control('name'); + echo $this->Form->control('email'); + echo $this->Form->control('body'); echo $this->Form->button('Submit'); echo $this->Form->end(); diff --git a/en/elasticsearch.rst b/en/elasticsearch.rst index ea6b02ecbe..f424edf8da 100644 --- a/en/elasticsearch.rst +++ b/en/elasticsearch.rst @@ -77,8 +77,8 @@ We would also need to create a basic view for our indexed articles:: // in src/Template/Articles/add.ctp Form->create($article) ?> - Form->input('title') ?> - Form->input('body') ?> + Form->control('title') ?> + Form->control('body') ?> Form->button('Save') ?> Form->end() ?> diff --git a/en/orm/behaviors/translate.rst b/en/orm/behaviors/translate.rst index 99adde1913..68037ff20f 100644 --- a/en/orm/behaviors/translate.rst +++ b/en/orm/behaviors/translate.rst @@ -428,19 +428,19 @@ Now, You can populate translations before saving them:: $this->Articles->save($article); As of 3.3.0, working with multiple translations has been streamlined. You can -create form inputs for your translated fields:: +create form controls for your translated fields:: // In a view template. Form->create($article); ?>
French - Form->input('_translations.fr.title'); ?> - Form->input('_translations.fr.body'); ?> + Form->control('_translations.fr.title'); ?> + Form->control('_translations.fr.body'); ?>
Spanish - Form->input('_translations.es.title'); ?> - Form->input('_translations.es.body'); ?> + Form->control('_translations.es.title'); ?> + Form->control('_translations.es.body'); ?>
In your controller, you can marshal the data as normal, but with the diff --git a/en/orm/behaviors/tree.rst b/en/orm/behaviors/tree.rst index e1d2afe4a9..e9e5d2ae9d 100644 --- a/en/orm/behaviors/tree.rst +++ b/en/orm/behaviors/tree.rst @@ -90,7 +90,7 @@ display a list, in an HTML select for example, it is better to use the $list = $categories->find('treeList'); // In a CakePHP template file: - echo $this->Form->input('categories', ['options' => $list]); + echo $this->Form->control('categories', ['options' => $list]); // Or you can output it in plain text, for example in a CLI script foreach ($list as $categoryName) {