我的用户中有index.ctp,列出了所有用户。我添加了一个搜索输入来搜索某个用户。
<?= $this->Form->create(null, ['url' => false, 'type' => 'post']) ?>
<?= $this->Form->input('search', array('label' => '', 'placeholder' => 'Search users here...')); ?>
<?= $this->Form->button('Search') ?>
<?= $this->Form->end(); ?>
我有这个条件在哪里查看是否有帖子请求。
<?php
if ($this->request->is(['patch', 'post', 'put'])) {
$query = $this->Users->find('all', array('conditions' => array('users.name LIKE' => '%gol%')));
$result = $query->first();
echo $result->name;
} else {
?>
<?php foreach ($users as $user): ?>
<tr>
<td><?= $this->Number->format($user->id) ?></td>
<td><?= h($user->name) ?></td>
<td><?= h($user->username) ?></td>
<td><?= h($user->created) ?></td>
<td><?= h($user->modified) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $user->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $user->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
<?php } ?>
我有一个Missing Helper错误。消息是:&#34;找不到UsersHelper。&#34;