Search Results

Search found 43 results on 2 pages for 'indexcontroller'.

Page 1/2 | 1 2  | Next Page >

  • Extending the IndexController with a BaseController in Zend

    - by BillA
    I'm trying to extend my controllers with a global base controller as such: class BaseController extends Zend_Controller_Action { // common controller actions public function listAction() { // do stuff } } class IndexController extends BaseController { // index controller specific actions } class LoginController extends BaseController { // login controller specific actions } But I get this error: PHP Fatal error: Class 'BaseController' not found in /var/www/Zend/project/application/controllers/IndexController.php on line 3 Any ideas on how to get Zend to "see" this controller?

    Read the article

  • PHP ZF: I can't debug my IndexController.php actions code

    - by overthetop
    Hi I'm new to php and I'm using xampp, eclipse pdt, xdebug. I've set xdebug so that I can debug my site on apache but when I click 'debug as web page' in the eclipse ide only the breakpoint in the public/index.php and in the views get hit. If I put a breakpoin here public function indexAction() { // action body $this->view->s = "deam"; } the debugger don't stop?! why is that? I can't debug the most important part of my application. :( Plese help me with this.

    Read the article

  • Using default parameters for 404 error (PHP with mvc design)?

    - by user1175327
    I have a custom made Framework (written in PHP). It all works very good, but i have some doubts about a certain thing. Right now when a user call this url for example: http://host.com/user/edit/12 Which would resolve to: user = userController edit = editAction() in userController 12 = treated as a param But suppose the controller 'userController' doesn't exist. Then i could throw a 404. But on the other hand, the url could also be used as params for the indexController (which is the default controller). So in that case: controller = indexController user = could be an action in indexController, otherwise treated as a param edit = treated as a param 12 = treated as a param That is actually how it works right now in my framework. So basically, i never throw a 404. I could ofcourse say that only params can be given if the controller name is explicitly named in the URL. So if i want the above url: http://host.com/user/edit/12 To be invoked by the indexController, in the indexAction. Then i specifically have to tell what controller and action it uses in the URL. So the URL should become: http://host.com/index/index/user/edit/12 index = indexController index (2nd one) = the action method user = treated as a param edit = treated as a param 12 = treated as a param That way, when a controller doesn't exist, i don't reroute everything as a param to the index controller and simply throw a 404 error. Now my question is, which one is more preffered? Should i allow both options to be configurable in a config file? Or should i always use one of them. Simply because that's the only and best way to do it?

    Read the article

  • ZF2 namespace and file system

    - by user1918648
    I have standard Application module in ZF2. It's configured by default, I didn't change anything. I just added some stuff: module/ Application/ src/ Application/ Entity/ Product/ **Product.php** Controller/ **IndexController.php** Product.php namespace Application\Entity; class Product { } IndexController.php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; use Application\Entity\Product; class IndexController extends AbstractActionController { public function indexAction() { $product = new Product(); } } and I get following error: Fatal error: Class 'Application\Entity\Product' not found in \module\Application\src\Application\Controller\IndexController.php on line 20 I use the same namespace, but it doesn't see it. Why? P.S: If I will change Product.php to be the following: namespace Application\Entity\Product; class Product { } then in the IndexController.php the following code will be working: namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; use Application\Entity\Product\Product; class IndexController extends AbstractActionController { public function indexAction() { $product = new Product(); } }

    Read the article

  • url not found in zend framework though working for index page

    - by Rohan Thakare
    i am trying to develop website using zend framework so i had created one index.php file where all my requests goes and c.reated two controller one is IndexController and other is TestController Class IndexController extends Zend_Controller_Action{ public function indexAction(){ echo "Index Index Jamla"; } public function displayAction(){ echo "Index Display Jamla"; } } now when i access the url http://test/ it correctly calls IndexController and its IndexAction function but when i access the url http://test/index/index it displays the message url /index/index was not found on this server same it does when i access http://test/test/index though http://test/ is equivalent to http://test/index/index

    Read the article

  • ASP.NET MVC unit test controller with HttpContext

    - by user299592
    I am trying to write a unit test for my one controller to verify if a view was returned properly, but this controller has a basecontroller that accesses the HttpContext.Current.Session. Everytime I create a new instance of my controller is calls the basecontroller constructor and the test fails with a null pointer exception on the HttpContext.Current.Session. Here is the code: public class BaseController : Controller { protected BaseController() { ViewData["UserID"] = HttpContext.Current.Session["UserID"]; } } public class IndexController : BaseController { public ActionResult Index() { return View("Index.aspx"); } } [TestMethod] public void Retrieve_IndexTest() { // Arrange const string expectedViewName = "Index"; IndexController controller = new IndexController(); // Act var result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result, "Should have returned a ViewResult"); Assert.AreEqual(expectedViewName, result.ViewName, "View name should have been {0}", expectedViewName); } Any ideas on how to mock the Session that is accessed in the base controller so the test in the descendant controller will run?

    Read the article

  • J2EE fast track (Learning Enterprise Java real fast)

    - by IndexController
    Hello, We just started a new project in J2EE in our office and i am required to participate effectively. I mostly work on web applications and I use PHP/MySql but I also know J2SE and have written couple of standalone applications. I need help and advise on how i can learn J2ee very fast so that i can blend into the project without difficulties. I need help with book & tutorial recommendations and also links to resources. Thank you for your time.

    Read the article

  • How to use global view files in Zend Framework?

    - by terrani
    Hi, I am trying to use global or shared view files. Let's say I have a module in Application/Modules/default and I have "IndexController.php" inside "default/controllers" within "IndexController", I would like to render a view that is located in "Application/Views". I tried to use addScriptPath, but Zend_View tries to look "Application/Views/index" directory. How do I eliminate "index" ?

    Read the article

  • Spring MVC and Weblogic integration

    - by Jeune
    I get this error whenever I try to view my tutorial app in the browser WARNING: No mapping found for HTTP request with URI [/HelloWorld.Web] in DispatcherServlet with name 'dispatcher' That just means the request is being received by the dispatcher servlet but it can't forward it to a controller. But I can't seem to know where the problem is. I think I've mapped this correctly: <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/HelloWorld.Web">indexController</prop> </props> </property> </bean> <bean id="indexController" class="com.helloworld.controller.IndexController"> <property name="artistDao" ref="artistDao"/> <property name="methodNameResolver"> <bean class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver"> <property name="alwaysUseFullPath" value="true"/> <property name="mappings"> <props> <prop key="/HelloWorld.Web">getAllArtists</prop> </props> </property> </bean> </property> </bean> I am using Spring 2.5.6 and Bea Weblogic Server 9.2

    Read the article

  • Zend Framework Handle One to Many

    - by user192344
    I have 2 tables "user", "contact", the relation between two tables is one user has many contact Table member m_id name ------------ Table Contact c_id c_m_id value in zend model class, i do it in this way /* Member.php */ class Default_Model_DbTable_Member extends Zend_Db_Table_Abstract { protected $_name = 'member'; protected $_dependentTables = array('Default_Model_DbTable_Contact'); } /* Contact.php */ class Default_Model_DbTable_Contact extends Zend_Db_Table_Abstract { protected $_name = 'contact'; protected $_referenceMap = array( 'Member' => array( 'columns'=> array('c_id'), 'refTableClass'=> 'Default_Model_DbTable_Member', 'refColumns'=> array('c_m_id') ) ); /* IndexController.php */ class IndexController extends Zend_Controller_Action { public function indexAction() { $m= new Default_Model_DbTable_Member(); $row = $m->find(1); $data = $row->current(); $data = $data->findDependentRowset('Default_Model_DbTable_Contact'); print_r($data->toArray()); } } But i just get Invalid parameter number: no parameters were bound , my goal is to search a member detail record, and it also contains a array which store all contact info (i can use join method to do that, but i just want to try zend feature)

    Read the article

  • How to insert value to Magento database using module

    - by Kasmin Nicko
    I want to insert value to the database I created. The value would be insert to post column. I have code like this in the IndexController.php class My_Module_IndexController extends Mage_Core_Controller_Front_Action { public function postAction() { $post = Mage::getModel('my/model'); $post->setPost('My Post Here'); $post->save(); } } But after I ran this script, I got the following error Fatal error: Call to a member function setPost() on a non-object in C:\xampp\htdocs\magento\app\code\community\My\Module\controllers\IndexController.php on line 7 What is something I miss?

    Read the article

  • Zend Studio Debugger returns Application Error

    - by Keyne
    When I run debug for my public/index.php I got an application error as output. I've seen that it occurs at this line: foreach($feed->findFeedEntries($entriesLimit) as $entry) If I put a breakpoint before this, all works as expected, I mean, the error is after the line above. If I remove findFeedEntries() method, I can perform debugging without erros. To clarify, this method is in my row object as described bellow: This is the error <?php class Model_DbTable_FeedEntries extends Zf_Db_Table { public function fetchNewEntries($feed_id) { $Feeds = new Model_DbTable_Feeds(); $Feed = $Feeds->getById($feed_id); // ERROR IS HERE! The colum doesn't exists! // And this is only on zend-debugger!!! var_dump($Feed->link) // ... } } I'm completely lost about what's happening, once my application has no errors, the problem is with zend-debugger. The error is: An error occurred Application error Exception information: Message: Specified column "link" is not in the row Stack trace: #0 C:\Program Files\xampp\htdocs\desenvolvimentistas\application\models\DbTable\FeedEntries.php(75): Zend_Db_Table_Row_Abstract->__get('link') #1 C:\Program Files\xampp\htdocs\desenvolvimentistas\application\models\DbTable\FeedEntries.php(50): Model_DbTable_FeedEntries->fetchNewEntries('1') #2 C:\Program Files\xampp\htdocs\desenvolvimentistas\application\models\DbTable\Row\Feed.php(15): Model_DbTable_FeedEntries->getAllByFeedId('1', 1) #3 C:\Program Files\xampp\htdocs\desenvolvimentistas\application\modules\default\controllers\IndexController.php(41): Model_DbTable_Row_Feed->findFeedEntries(1) #4 C:\Program Files\xampp\htdocs\ZendFramework-1.10.0-minimal\library\Zend\Controller\Action.php(513): IndexController->indexAction() #5 C:\Program Files\xampp\htdocs\ZendFramework-1.10.0-minimal\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('indexAction') #6 C:\Program Files\xampp\htdocs\ZendFramework-1.10.0-minimal\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #7 C:\Program Files\xampp\htdocs\ZendFramework-1.10.0-minimal\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch() #8 C:\Program Files\xampp\htdocs\ZendFramework-1.10.0-minimal\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #9 C:\Program Files\xampp\htdocs\desenvolvimentistas\public\index.php(54): Zend_Application->run() #10 C:\Users\RAPOSO\AppData\Local\Temp\dummy.php(1): include('C:\Program File...') #11 {main} I've notice that when I get the row object my colums names are not right. Instead of have "title", "link", ... I have "feeds", "desenvolvimentistas" (projectname), and so on...

    Read the article

  • Zend Framework: Zend_DB Error

    - by Sergio E.
    I'm trying to learn ZF, but got strange error after 20 minutes :) Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'Configuration array must have a key for 'dbname' that names the database instance' What does this error mean? I got DB information in my config file: resources.db.adapter=pdo_mysql resources.db.host=localhost resources.db.username=name resources.db.password=pass resources.db.dbname=name Any suggestions? EDIT: This is my model file /app/models/DbTable/Bands.php: class Model_DbTable_Bands extends Zend_Db_Table_Abstract { protected $_name = 'zend_bands'; } Index controller action: public function indexAction() { $albums = new Model_DbTable_Bands(); $this->view->albums = $albums->fetchAll(); } EDIT All codes: bootstrap.php protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => '', 'basePath' => dirname(__FILE__), )); return $autoloader; } protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); } public static function setupDatabase() { $config = self::$registry->configuration; $db = Zend_Db::factory($config->db); $db->query("SET NAMES 'utf8'"); self::$registry->database = $db; Zend_Db_Table::setDefaultAdapter($db); Zend_Db_Table_Abstract::setDefaultAdapter($db); } IndexController.php class IndexController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $albums = new Model_DbTable_Bands(); $this->view->albums = $albums->fetchAll(); } } configs/application.ini, changed database and provided password: [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 db.adapter = PDO_MYSQL db.params.host = localhost db.params.username = root db.params.password = pedro db.params.dbname = test models/DbTable/Bands.php class Model_DbTable_Bands extends Zend_Db_Table_Abstract { protected $_name = 'cakephp_bands'; public function getAlbum($id) { $id = (int)$id; $row = $this->fetchRow('id = ' . $id); if (!$row) { throw new Exception("Count not find row $id"); } return $row->toArray(); } }

    Read the article

  • Zend Framework: How to display multiple actions, each requiring different authorizations levels, on

    - by Iain
    Imagine I have 4 database tables, and an interface that presents forms for the management of the data in each of these tables on a single webpage (using the accordion design pattern to show only one form at a time). Each form is displayed with a list of rows in the table, allowing the user to insert a new row or select a row to edit or delete. AJAX is then used to send the request to the server. A different set of forms must be displayed to different users, based on the application ACL. My question is: In terms of controllers, actions, views, and layouts, what is the best architecture for this interface? For example, so far I have a controller with add, edit and delete actions for each table. There is an indexAction for each, but it's an empty function. I've also extended Zend_Form for each table. To display the forms, I then in the IndexController pass the Forms to it's view, and echo each form. Javascript then takes care of populating the form and sending requests to the appropraite add/edit/delete action of the appropriate controller. This however doesn't allow for ACL to control the display or not of Forms to different users. Would it be better to have the indexAction instantiate the form, and then use something like $this-render(); to render each view within the view of the indexAction of the IndexController? Would ACL then prevent certain views from being rendered? Cheers.

    Read the article

  • How to stop Zend Framework from appending '/scripts/' to the View Base Path

    - by Hannes
    Thats basically my code (simplified): class IndexController extends Zend_Controller_Action { public function indexAction(){ $this->view->setBasePath(APPLICATION_PATH . '/views/partner/xyz/'); $this->view->render('node.phtml'); } } Now what I (obvoiusly) want is to use the view script APPLICATION_PATH . '/views/partner/xyz/node.phtml' but ZF always tries to load APPLICATION_PATH . '/views/partner/xyz/scripts/node.phtml' is there any Way around that Behviour?

    Read the article

  • certain Smarty tags don't work in OpenX templates

    - by mikez302
    I am on a team that is developing an OpenX plugin, and I am responsible for the UI. I noticed that if I use certain Smarty tags in my template, the app doesn't work and I see an error message, similar to this: Plugin by name 'Html_select_date' was not found in the registry; used paths: default_views_helpers_: /openx/www/admin/plugins/myApp/application/modules/default/views/helpers/ OX_OXP_UI_View_Helper_: /openx/www/admin/plugins/myApp/application/../library/OX/OXP/UI/View/Helper/ OX_UI_View_Helper_: /openx/www/admin/plugins/myApp/application/../library/OX/UI/View/Helper/ Zend_View_Helper_: Zend/View/Helper/ (stack trace) The stack trace looks like this: #0 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(1117): Zend_Loader_PluginLoader-load('Html_select_dat...') #1 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(568): Zend_View_Abstract-_getPlugin('helper', 'html_select_dat...') #2 /openx/www/admin/plugins/myApp/library/OX/UI/Smarty/SmartyWithViewHelper.php(25): Zend_View_Abstract-getHelper('html_select_dat...') #3 /openx/var/templates_compiled/%2Fdefault%2Fviews%2Fscripts%2Findex%2Fview-reports.html^%%E8^E80^E80B56F2%%view-reports.html.php(38): OX_UI_Smarty_SmartyWithViewHelper-callViewHelper('html_select_dat...', Array) #4 /openx/lib/smarty/Smarty.class.php(1274): include('/openx...') #5 /openx/www/admin/plugins/myApp/library/OX/UI/View/SmartyView.php(103): Smarty-fetch('/openx...') #6 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(832): OX_UI_View_SmartyView-_run('/openx...') #7 /openx/www/admin/plugins/myApp/library/OX/UI/View/SmartyView.php(151): Zend_View_Abstract-render('index/view-repo...') #8 /openx/www/admin/plugins/myApp/library/OX/UI/View/Helper/WithViewScript.php(23): OX_UI_View_SmartyView-render('index/view-repo...') #9 /openx/www/admin/plugins/myApp/application/modules/default/views/helpers/ViewReports.php(5): OX_UI_View_Helper_WithViewScript::renderViewScript('index/view-repo...', Array) #10 /openx/www/admin/plugins/myApp/application/modules/default/controllers/IndexController.php(98): Default_Views_Helpers_ViewReports-renderPage() #11 /openx/www/admin/plugins/myApp/library/Zend/Controller/Action.php(512): IndexController-viewReportsAction() #12 /openx/www/admin/plugins/myApp/library/Zend/Controller/Dispatcher/Standard.php(288): Zend_Controller_Action-dispatch('viewReportsActi...') #13 /openx/www/admin/plugins/myApp/library/Zend/Controller/Front.php(945): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #14 /openx/www/admin/plugins/myApp/application/bootstrap.php(117): Zend_Controller_Front-dispatch() #15 /openx/www/admin/plugins/myApp/public/index.php(7): require('/openx...') #16 {main} This does not happen with all Smarty tags. For example, I can use {if}, {foreach}, or {assign} tags without any problems. But whenever I try to use {html_select_date}, {html_image}, or {html_table}, I get the errors. In case this matters, the programmer who is designing the plugin copied the openXWorkflow plugin and made some changes. I noticed that the openXWorkflow plugin has a file (openx/plugins_repo/openXWorkflow/www/admin/plugins/openXWorkflow/library/OX/UI/Smarty/SmartyCompilerWithViewHelper.php) with a class that overrides the default Smarty compiler, supposedly with the ability to compile shorthands for calling ZF view helpers. That file has a list of Smarty functions, but the list is incomplete. If I add the functions to the list, or simply delete the file, my template works fine, but I don't like to change library files. It may make the app hard to maintain, and I don't know if it will mess up something else. The file has the comment "There is no easy access to the list of Smarty's built-in functions so we need to list them here. HTML-specific functions are not included as we cover HTML generation separately.", so it seems like certain Smarty functions may be disabled on purpose for some reason. Will anything bad happen if I try to use them? If, for example, I want to use the {html_select_date} tag in my template, how would I go about doing that? Keep in mind that much of this stuff is new and unfamiliar to me. This is my first time ever using OpenX or Smarty, and I only have a little bit of experience with the Zend framework. Please let me know if we are using the wrong approach.

    Read the article

  • How can I display the clicked products by user on a list in another view?

    - by Avar
    I am using MVC3 Viewmodel pattern with Entity Framework on my webbapplication. My Index View is list of products with image, price and description and etc. Products with the information I mentioned above is in div boxes with a button that says "buy". I will be working with 2 views one that is the Index View that will display all the products and the other view that will display the products that got clicked by the buy button. What I am trying to achieve is when a user click on buy button the products should get stored in the other view that is cart view and be displayed. I have problems on how to begin the coding for that part. The index View with products is done and now its the buy button function left to do but I have no idea how to start. This is my IndexController: private readonly HomeRepository repository = new HomeRepository(); public ActionResult Index() { var Productlist = repository.GetAllProducts(); var model = new HomeIndexViewModel() { Productlist = new List<ProductsViewModel>() }; foreach (var Product in Productlist) { FillProductToModel(model, Product); } return View(model); } private void FillProductToModel(HomeIndexViewModel model, ProductImages productimage) { var productViewModel = new ProductsViewModel { Description = productimage.Products.Description, ProductId = productimage.Products.Id, price = productimage.Products.Price, Name = productimage.Products.Name, Image = productimage.ImageUrl, }; model.Productlist.Add(productViewModel); } In my ActionResult Index I am using my repository to get the products and then I am binding the data from the products to my ViewModel so I can use the ViewModel inside my view. Thats how I am displaying all the products in my View. This is my Index View: @model Avan.ViewModels.HomeIndexViewModel @foreach (var item in Model.Productlist) { <div id="productholder@(item.ProductId)" class="productholder"> <img src="@Html.DisplayFor(modelItem => item.Image)" alt="" /> <div class="productinfo"> <h2>@Html.DisplayFor(modelItem => item.Name)</h2> <p>@Html.DisplayFor(modelItem => item.Description)</p> @Html.Hidden("ProductId", item.ProductId, new { @id = "ProductId" }) </div> <div class="productprice"> <h2>@Html.DisplayFor(modelItem => item.price)</h2> <input type="button" value="Läs mer" class="button" id="button@(item.ProductId)"> @Html.ActionLink("x", "Cart", new { id = item.ProductId }) // <- temp its going to be a button </div> </div> } Since I can get the product ID per product I can use the ID in my controller to get the data from the database. But I still I have no idea how I can do that so when somebody click on the buy button I store the ID where? and how do I use it so I can achieve what I want to do? Right now I have been trying to do following thing in my IndexController: public ActionResult cart(int id) { var SelectedProducts = repository.GetProductByID(id); return View(); } What I did here is that I get the product by the id. So when someone press on the temp "x" Actionlink I will recieve the product. All I know is that something like that is needed to achieve what im trying to do but after that I have no idea what to do and in what kind of structure I should do it. Any kind of help is appreciated alot! Short Scenario: looking at the Index I see 5 products, I choose to buy 3 products so I click on three "Buy" buttons. Now I click on the "Cart" that is located on the nav menu. New View pops up and I see the three products that I clicked to buy.

    Read the article

  • [Gdata] GetAuthSubToken returns None

    - by Matt
    Hey guys, I am a little lost on how to get the auth token. Here is the code I am using on the return from authorizing my app: client = gdata.service.GDataService() gdata.alt.appengine.run_on_appengine(client) sessionToken = gdata.auth.extract_auth_sub_token_from_url(self.request.uri) client.UpgradeToSessionToken(sessionToken) logging.info(client.GetAuthSubToken()) what gets logged is "None" so that does seem right :-( if I use this: temp = client.upgrade_to_session_token(sessionToken) logging.info(dump(temp)) I get this: {'scopes': ['http://www.google.com/calendar/feeds/'], 'auth_header': 'AuthSub token=CNKe7drpFRDzp8uVARjD-s-wAg'} so I can see that I am getting a AuthSub Token and I guess I could just parse that and grab the token but that doesn't seem like the way things should work. If I try to use AuthSubTokenInfo I get this: Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 507, in __call__ handler.get(*groups) File "controllers/indexController.py", line 47, in get logging.info(client.AuthSubTokenInfo()) File "/Users/matthusby/Dropbox/appengine/projects/FBCal/gdata/service.py", line 938, in AuthSubTokenInfo token = self.token_store.find_token(scopes[0]) TypeError: 'NoneType' object is unsubscriptable so it looks like my token_store is not getting filled in correctly, is that something I should be doing? Also I am using gdata 2.0.9 Thanks Matt

    Read the article

  • How do I use Zend Cache on this particular problem

    - by davykiash
    I have an action that renders two different view scripts based on whether the user is logged in or not. class IndexController extends Zend_Controller_Action { .... public function indexAction() { $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { $this->render('indexregistered'); return; } else { $this->render('indexpublic'); return; } } .... } I have seen quite some useful examples on how to use the Zend Cache and they seem to be based on the fact that the action renders one particular script. What am really looking at is the best approach to cache the the indexpublic script does get quite some hits and I would live to avoid the Zend MVC overhead if possible.

    Read the article

  • Design Patterns: What's the antithesis of Front Controller?

    - by Brian Lacy
    I'm familiar with the Front Controller pattern, in which all events/requests are processed through a single centralized controller. But what would you call it when you wish to keep the various parts of an application separate at the presentation layer as well? My first thought was "Facade" but it turns out that's something entirely different. In my particular case, I'm converting an application from a sprawling procedural mess to a clean MVC architecture, but it's a long-term process -- we need to keep things separated as much as possible to facilitate a slow integration with the rest of the system. Our application is web-based, built in PHP, so for instance, we have an "index.php" and an IndexController, a "account.php" and an AccountController, a "dashboard.php" and DashboardController, and so on.

    Read the article

  • Can't reach the new zend controller/view

    - by Zakaria
    Hi, I've installed Zend Studio 7.1.1 that contains 1.9 framework. For the server side, I use easyphp (very similar to wamp) When I create the project, I obviously obtain this architecture: MyProject |-- application | |-- Bootstrap.php | |-- configs | | `-- application.ini | |-- controllers | | |-- ErrorController.php | | `-- IndexController.php | |-- models | `-- views | |-- helpers | `-- scripts | |-- error | | `-- error.phtml | `-- index | `-- index.phtml |-- library |-- public | |-- .htaccess | `-- index.php `-- tests |-- application | `-- bootstrap.php |-- library | `-- bootstrap.php `-- phpunit.xml To launch the project, I enter: http://127.0.0.1/MonProjet/public/index.php But when I create a new controller (TestController.php) and the associated view (application.views/test/index.phtml) and when I enter: http://127.0.0.1/MonProjet/public/test the browser returns the error : object not found (404). although I activated the mod_rewrite LoadModule rewrite_module modules/mod_rewrite.so So, how can I set the routing mechanism to reach the new controllers and their views? Thank you very much, regards.

    Read the article

1 2  | Next Page >