Skip to content

Commit

Permalink
Merge pull request #7878 from cakephp/ADmad-patch-2
Browse files Browse the repository at this point in the history
Update intro.rst
  • Loading branch information
markstory authored Jun 30, 2024
2 parents 233a193 + 3e9d042 commit 27162d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions en/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The model objects can be thought of as "Friend", "User", "Comment", or

use Cake\ORM\Locator\LocatorAwareTrait;

$users = $this->getTableLocator()->get('Users');
$users = $this->fetchTable('Users');
$resultset = $users->find()->all();
foreach ($resultset as $row) {
echo $row->username;
Expand All @@ -52,7 +52,7 @@ something like::

use Cake\ORM\Locator\LocatorAwareTrait;

$users = $this->getTableLocator()->get('Users');
$users = $this->fetchTable('Users');
$user = $users->newEntity(['email' => '[email protected]']);
$users->save($user);

Expand All @@ -67,7 +67,7 @@ For example, the view could use model data to render an HTML view template conta
or a XML formatted result for others to consume::

// In a view template file, we'll render an 'element' for each user.
<?php foreach ($users as $user): ?>
<?php foreach ($resultset as $user): ?>
<li class="user">
<?= $this->element('user_info', ['user' => $user]) ?>
</li>
Expand Down

0 comments on commit 27162d0

Please sign in to comment.