Reputation: 393
I have this button in my controller and trying to echo it back to the user in my view phtml but its seems not to be returning the element.
Button
$button = new Zend_Form_Element_button('button');
$button->setAttrib('id', 'B!');
$button->setLabel('Previous');
$button->setAttrib('onClick', "parent.location='" . Zend_Controller_Front::getInstance()->getBaseUrl() .'/../..' ."'");
$this->view->button = $button;
in my view
<?php echo $this->button; ?>
Upvotes: 2
Views: 235
Reputation: 5772
Your code work in my application.
If you just want a button, you can do something like that:
In your Controller :
$this->view->location = "parent.location='" . Zend_Controller_Front::getInstance()->getBaseUrl() .'/../..' . "'";
In the view
<input id="B" type="button" value="Previous" onClick="<?php echo $this->location;?>">
Upvotes: 1