Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions en/core-libraries/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions en/elasticsearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ We would also need to create a basic view for our indexed articles::

// in src/Template/Articles/add.ctp
<?= $this->Form->create($article) ?>
<?= $this->Form->input('title') ?>
<?= $this->Form->input('body') ?>
<?= $this->Form->control('title') ?>
<?= $this->Form->control('body') ?>
<?= $this->Form->button('Save') ?>
<?= $this->Form->end() ?>

Expand Down
10 changes: 5 additions & 5 deletions en/orm/behaviors/translate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<?= $this->Form->create($article); ?>
<fieldset>
<legend>French</legend>
<?= $this->Form->input('_translations.fr.title'); ?>
<?= $this->Form->input('_translations.fr.body'); ?>
<?= $this->Form->control('_translations.fr.title'); ?>
<?= $this->Form->control('_translations.fr.body'); ?>
</fieldset>
<fieldset>
<legend>Spanish</legend>
<?= $this->Form->input('_translations.es.title'); ?>
<?= $this->Form->input('_translations.es.body'); ?>
<?= $this->Form->control('_translations.es.title'); ?>
<?= $this->Form->control('_translations.es.body'); ?>
</fieldset>

In your controller, you can marshal the data as normal, but with the
Expand Down
2 changes: 1 addition & 1 deletion en/orm/behaviors/tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down