Cakephp搜索功能

时间:2015-10-24 09:33:18

标签: cakephp-3.0

我在我的表externalclient中创建搜索 我在externalclientController.php

中尝试了这段代码
char[]

我创建了search.ctp

public function search()
    {
        //performs the search

        //tells this method to use the index.ctp View to display the results
        //rather than looking for search.ctp
        $this->view = 'index';
    }

我添加到index.ctp的最后一件事

<?php
echo $this->Form->create('first_name',['action' => 'search']);
?>
<table cellpadding="2" cellspacing="2" width="50%" border="0">
<tr>
<td>Select Client</td>
<td>&nbsp;&nbsp;&nbsp;Enter Client Name</td>
</tr>
<tr>
<td>
<?php echo $this->Form->select('first_name', $externalClient,['empty' => ' ',
'label'=>'']); ?>
</td>
<td><?php echo $this->Form->input('name', ['label' =>'']); ?></td>
<td>
<?php echo $this->Form->submit(__('Search Client', true),
['name' => 'Search', 'div' => false]);?>
</td>
</tr>
</table>
<?= $this->Form->end() ?>

... 之后它给了我这个错误:

This is the output

0 个答案:

没有答案