I have a problem with ZF, my code looks OK, but I can't take the parameter ID, it return true, and i'm accesing the url right http://site.com/admin/news/newsedit/1
So my code looks like this:
Route
$ad = self::$frontController->getRouter();
$ad->addRoute('newsedit',
new Zend_Controller_Router_Route(
'news/newsedit/:id',
array(
'module' => 'admin',
'controller' => 'news',
'action' => 'newsedit'
)
)
);
Action
public function newseditAction()
{
/*
Disable Layout
*/
$this->_helper->layout->disableLayout();
/*
@return : boolen OR string
*/
$_id = ($this->_getParam('id') !== NULL) ? (int)$this->_getParam('id') : false;
if ($_id) {
/*
@return : array
*/
$_get = $this->news->select()->where('id = ?', $_id);
if (count($_get) > 0) {
$this->view->data = $_get;
}
}
Zend_Debug::dump($this->_getParam('id'));
}
What I'm doing wrong?