controller

Extending the IndexController with a BaseController in Zend

耗尽温柔 提交于 2019-12-04 11:13:55
问题 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

Custom forms in Magento

99封情书 提交于 2019-12-04 11:13:54
问题 Can anyone provide a dummy guide \ code snippets on how to create a front end form in Magento that posts data to a controller action. Im trying to write a variant of the contact us from. (I know its easy to modify the contact us form, as outlined here). I'm trying to also create a feedback form with additional fields. Given this basic form: <form action="<?php echo $this->getFormAction(); ?>" id="feedbackForm" method="post"> <div class="input-box"> <label for="name"><?php echo Mage::helper(

Magento: Extending Customer Account Controller to add actions to the forgot password steps

霸气de小男生 提交于 2019-12-04 10:32:52
We are trying to add a couple of actions to the AccountController to add another action after the forgotpasswordpost action. The problem is if we add the action to the preDispatch logict to make sure you don't have to be logged in it still redirects back to the login page. public function preDispatch() { // a brute-force protection here would be nice parent::preDispatch(); if (!$this->getRequest()->isDispatched()) { return; } $action = $this->getRequest()->getActionName(); if (!preg_match('/^(create|login|logoutSuccess|forgotpassword|forgotpasswordpost|confirm|confirmation|newactionhere)/i',

Render a .js controller request as html

﹥>﹥吖頭↗ 提交于 2019-12-04 09:59:00
I have a before_filter in my Rails app that sends users to login_url if they are logged out when they submit a request (in either html or js format). I would like my format.js to produce an identical result to format.html , in the following case to render the view with the 'notice' layout. How can I do this? respond_to do |format| format.js format.html{ render :layout => "notice" } end you can force the usable formats like this : respond_to do |format| format.js { render :layout => "notice", :formats => [:html] } format.html { render :layout => "notice" } end EDIT: What you need is some part

asp.net mvc 4 controller execute multiple ajax calls in parallel

一笑奈何 提交于 2019-12-04 09:23:52
问题 I have an asp.net MVC 4 controller thats methods are called via ajax. The problem is that the ajax requests are handled sequentially by the controller. This causes performance issues as the time to load the page is the sum of all ajax requests and not the longest ajax request. To demonstrate this, I put a break point in the first ("ReadOverview8Week") method. Each of these methods take ~600ms to execute individuality. http://i.stack.imgur.com/HhtEX.png How can I make the controller respond to

Implement your own object binder for Route parameter of some object type in Play scala

孤街醉人 提交于 2019-12-04 09:13:07
Well, I want to replace my String param from the following Play scala Route into my own object, say "MyObject" From GET /api/:id controllers.MyController.get(id: String) To GET /api/:id controllers.MyController.get(id: MyOwnObject) Any idea on how to do this would be appreciated. Use PathBindable to bind parameters from path rather than from query. Sample implementation for binding ids from path separated by comma (no error handling): public class CommaSeparatedIds implements PathBindable<CommaSeparatedIds> { private List<Long> id; @Override public IdBinder bind(String key, String txt) { if (

Android : Do Application Login in background on boot-up

北战南征 提交于 2019-12-04 08:00:59
I have a VOIP Application, I need to login the application in background on device bootup. Currently the init to my application is done on UI Active( onCreate() ). I have the following things in my mind, can anyone help and clear my doubts. The service design is must to achieve this task?? Which Service Remote(AIDL) or Local Service and why? How does the UI and Service interaction happens? After UI is active who gets the Call- Backs? UI or Service ? Should i make Service as my Controller i.e Service to UI data Pass Vice-versa? Sample App: Skype. So there are many ways to achieve what you want,

Default Routes in a Backbone.js controller?

二次信任 提交于 2019-12-04 07:48:20
问题 I want to set a default route for my backbone.js controller. Currently I do it like so: class DealSearchController extends Backbone.Controller routes: 'list' : 'showListView' 'photos' : 'showPhotoView' 'map' : 'showMapView' initialize: -> .... window.location.hash = 'list' if ! _.include( _.keys(@routes),(window.location.hash || '').replace('#','')) Is there a better way of doing it? 回答1: Try adding this additional route as the last route in your controller: '*path': 'defaultRoute' and then

Spring Controller's URL request mapping not working as expected

旧街凉风 提交于 2019-12-04 07:34:48
I have created a mapping in web.xml something like this: <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/about/*</url-pattern> </servlet-mapping> In my controller I have something like this: import org.springframework.stereotype.Controller; @Controller public class MyController{ @RequestMapping(value="/about/us", method=RequestMethod.GET) public ModelAndView myMethod1(ModelMap model){ //some

How do I load CodeIgniter helpers in every page?

做~自己de王妃 提交于 2019-12-04 07:31:08
I have a view, header.php, that gets loaded in various controller methods. It contains my opening html tag, a base tag for my relative links, and some meta tags that I call in every page of my application. Is there way to load the helpers that render the meta tags and base url so that they are available to header.php every time it is loaded without having to include $this->load->helper('html'); and $this->load->helper('url'); every time I $this->load->view('templates/header', $data); in a controller to load header.php? If you're needing these that often, you should just add those to your