2013-10-03 29 views
0

我是Zend Framwork的新手。我想在現有模塊上添加搜索功能。當用戶在文本框中輸入名稱時,它應該返回相應的記錄。有人可以幫我添加這個功能嗎?Zend Framework添加搜索選項

感謝

PS:我不想利用Lucene

+0

我知道你說你不不要但是,你應該考慮lucene,這是相當容易使用,並且將是一個更好,更快的方式來實現搜索.. –

回答

0

使用此功能:

define thes variable in your model 

,並添加此功能

protected $_name = 'your_table_name';// table name 


public function getAll($order = null, $count = null, $offset = null) { 

     $rows = $this->fetchAll(NULL, $order, $count, $offset); 

     return $rows->toArray(); 
    }