Questions tagged [zend-controller]

114 questions
11
votes
3 answers

Zend Framework - Set No Layout for Controller

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…
ashurexm
  • 6,209
  • 3
  • 45
  • 69
8
votes
4 answers

Zend different view scripts?

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…
db83
  • 169
  • 1
  • 4
  • 13
7
votes
1 answer

How to access URL parameters in bootstrap

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(); …
elbicho
  • 365
  • 1
  • 3
  • 12
5
votes
3 answers

How run zend framework action (inside index controller) by cron every 12 hours?

How run zend framework action (inside index controller) by cron every 12 hours? The case: I have basic(no modules) zend project (1.11) that created by zf tool. Inside main IndexController exist cronAction() - url http://mydomain/index/cron. Need to…
Ben
  • 25,389
  • 34
  • 109
  • 165
5
votes
3 answers

Zend Framework MVC redirecting to different controller and action

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…
zend novice
  • 53
  • 1
  • 4
4
votes
2 answers

Invalid Controller Specified Error, even though the controller is present

I have a camelcased controller name called MenuItem. And Also I have created a router for this particular controller as $routeMenuItem = new Zend_Controller_Router_Route('/menu-item/:action/:menu/:parent/:id/*', array( 'controller' =>…
mrN
  • 3,734
  • 15
  • 58
  • 82
4
votes
1 answer

Zend Controller Action: _redirect() vs getHelper('Redirector')->gotoUrl()

I've read that $this->getHelper('[helper_name]') is preferable to $this->_helper->[helper_name]. What I haven't been able to find any documentation of is which of these is better/preferred: $this->_redirect($url) or…
Sonny
  • 8,204
  • 7
  • 63
  • 134
4
votes
3 answers

Zend_Controller_Action _forward use (or abuse) cases

While developing a web app using ZF, I had an haha! moment regarding the _forward method in Zend_Controller_Action. As stated in the Programmer's Reference Guide, when calling the _forward method inside an action, the requested action will not be…
Fatmuemoo
  • 2,187
  • 3
  • 17
  • 34
4
votes
2 answers

Zend Framework - Extend Module Controller

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…
Matt McCormick
  • 13,041
  • 22
  • 75
  • 83
4
votes
1 answer

In ZF2 how to make view functions to run in controller

I wanted the functionalities of view files to run in controller file also. For example, I wanted $this->escapeHtml() which runs in view file alone to run in controller through some means like $this->...->escapeHtml() Is this possible? Kindly help.
Beniston
  • 542
  • 1
  • 8
  • 17
4
votes
2 answers

Zend Framework - How can i share common code between some of a controller's actions?

To keep my controllers as DRY as possible i need to share some common code (a big chunk of code) between say 2 of my controller's actions and not all of them and i need access variables in this shared code in my actions. For example: class…
Mouna Cheikhna
  • 38,870
  • 10
  • 48
  • 69
3
votes
2 answers

Zend framework action parameter

I want to pass an entire path as an action parameter to my controller action. mycontroller/myaction/myparameter/path_value e.g. path_value could be something like test/folder/folder2 I do not want to urlencode the parameter. Is it possible that in…
Prashant
  • 7,340
  • 2
  • 25
  • 24
3
votes
2 answers

Zend Framework: extend custom base controller from Zend_Controller_Action

I want my controllers to be extended from my base controller (no from Zend_Controller_Action). How can I extend my base Contoller from Zend_Contoller_Action. And where this custom base controller to be placed so it will be accessible to other…
Simpanoz
  • 2,729
  • 10
  • 43
  • 64
3
votes
1 answer

ZF2: change view script from controller factory

In ZF2, I have 2 helpers. A helper has a form, and a mapper to handle the database interaction. I pass these helpers to the controller using a controller factory. The controller handles phones and addresses of a party that is either a person or an…
Dima Dz
  • 512
  • 1
  • 5
  • 17
3
votes
3 answers

Getting the baseurl value into my controllers

Am creating an action helper that will require the return value of the Zend_View_Helper_BaseUrl How do I go about that?
davykiash
  • 1,796
  • 5
  • 27
  • 60
1
2 3 4 5 6 7 8