I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is there anyway I can do...
Hi,
I have a controller that passes input from a form into a model class to perform validation.
If the validation is successful I want to allow the flow to continue and render the default view associated with the controller.
My issue is that if validation is not successful then I want the model to pass back validation error messages an...
Is there anyway to create a vanity url "catch all" route whilst maintaining the default /module/controller/action/value routing structure?
Thanks!
...
I seem to have a problem with my layout displaying twice. I was wondering if this was caused by something in my front controller plugin (see below) which utilises Zend Layout only for a particular module and not in the main application. Any answers will be much appreciated. Thanks
class My_Controller_Plugin_AdoptLayout extends Zend_Cont...
Hi you all:
I'm trying to capture a URL parameter in my bootstrap file but after several attempts I'm not able to do it.
I've tried this but it does not work:
protected function _initGetLang() {
$frontController = Zend_Controller_Front::getInstance();
$lang= $frontController->getParam('lang');
}
Is this the right way to do it?
...
I want to display a page that has 2 forms. The top form is unique to this page, but the bottom form can already be rendered from a different controller. I'm using the following code to call the action of the other form but keep getting this error:
"Message: id is not specified"
#0 .../library/Zend/Controller/Router/Rewrite.php(441):...
I have downloaded a third party action helper that I would like to add to my application. How can I do this?
...
I use the following code with my Zend Framework application:
controller:
$paramsOtherAction = $this->getRequest()->getParams();
$paramsOtherAction['action'] = 'otheraction'
$this->view->paramsOtherAction = $paramsOtherAction;
view:
<a href="<?php echo $this->url($this->paramsOtherAction)?>"> Do other action with same params </a>
T...
Hi all,
I have a controller Employee , in that i have the action detail . The detail action prints like the attached image.
Suppose there is a save pdf button, i need to print this page as .pdf.. How can i do this ? Pls help me
Thanks in advance
Nisanth
...
Am creating an action helper that will require the return value of the
Zend_View_Helper_BaseUrl
How do I go about that?
...
I have the following directory structure:
modules/
api/
controllers/
ApiController.php
InventoryController.php
OtherController.php
The init() method is common amongst multiple Controllers so I want to refactor that into a parent Controller class such as:
class Api_ApiController extends Zend_Controller_Action
{...
I am getting fatal error after adding the action helper class. I am trying to load layout corresponding to called layout. Following is my code snippet:
First of all i added a helper class under application/controller/helpers:
class Zend_Controller_Action_Helper_Layout extends Zend_Controller_Action_Helper_Abstract {
public $pluginLoad...
Hi,
I new in Zend.
Main Question:
Is this code good for user login (Its beginning- because that I want to know if its can be improve)?
Thanks
view index.phtml
<? echo $this->form
controller IndexAction.php
public function indexAction() {
$form=new Application_Form_Login();
$this->view->form = $form;
if ($th...
Hi,
Zend_Form:: When should be form created in view and not in controller?
option 1 - form created in controller and passed to view (usually used)
controller:
$form=new MyForm();
$this->view->form=$form;
view:
echo $this->form;
option 2 - form created in view directly (looks better to me because form its subpart of view)
view:...
I have a Controller that I want to use for ajax scripts to call and set session variables, get information, etc. How do I set it so that that particular controller doesn't use the default layout (specifically NO layout) so that it can send XML/JSON messages back and forth? I have an inkling I should use a custom route but I do not know m...
I am starting to write some test cases for controller classes using Zend Framework 1.10.6 and Zend_Test_PHPUnit_ControllerTestCase. I am having problems with one item, which is that while the test cases are running, Zend_Controller_Action_HelperBroker can't find the Layout action helper.
Here are the bare bones of my test case:
requir...
I have a folder that contains uploaded documents that my ZF application can spit out to logged in users. I want them to be able to use a link like http://server/documents/filename.pdf and download the file, but I want to have a controller DocumentsController that enables the existing user cookies to verify that they are logged in and hav...
The following code fails throws a Zend_Controller_Exception ("Invalid value passed to setPost(); must be either array of values or key/value pair")
/** Model_Audit_Luminaire */
$luminaireModel = new Model_Audit_Luminaire();
if (!$fixture = $luminaireModel->getScheduleItem($scheduleId)) {
$this->fail('Could not retrieve fixture from ...
i'm trying to work out how i can stop zend or redirect zend to go to a different zend controller and action if a check within the boot strap fails.
for example a get variable does not exist or more likely a session does not exist meaning the user must log in.
so the user had originally requested index/someaction
but i want them to go ...