FetchAll method requires using select() (http://framework.zend.com/manual/en/zend.db.select.html)
In your situation, it should look something like this:
$articles = new Articles();
$type= (int)$this->_request->getParam('type');
$type= (int)$this->_request->getParam('type');
$select = $articles->select()->where('type = ?', $type);
$this->view->articles = $articles->fetchAll($select);
$this->view->articles = $articles->fetchAll($select);
--
Aurelijus Valeiša
http://www.Aurelijus.eu
Aurelijus Valeiša
http://www.Aurelijus.eu
On Sat, Nov 1, 2008 at 11:03 PM, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:
Hello
I am trying to get the request from with type but everytime I am endind up with fetching all the records from database..
The request is coming as
article/view/type/PHP
So under the ArticleController I created a viewAction function as...
$articles = new Articles();
$type= (int)$this->_request->getParam('type');
$this->view->articles = $articles->fetchAll('type='.$type);
When I click the article type it still lists me all the articles...Can you guys give me an hint or link to read..
Thanks
没有评论:
发表评论