Questions tagged [controllers]

Denotes questions about controllers and action methods

Question related to Magento controllers(Admin, frontend).

Magento 1 : http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-3.html

Magento 2: http://devdocs.magento.com/guides/v2.1/architecture/archi_perspectives/controllers_intro.html

980 questions
30
votes
2 answers

Why c is lowercase in controllers of Magento?

Why is c lowercase in controllers folder name? Whereas Model, Block and Helper are starting with an uppercase letter?
Muthu
  • 303
  • 2
  • 4
8
votes
1 answer

Reliable way to redirect to last page

Is there a reliable way in magento to redirect to the last page. I have a small form that i want to redirect to the previous page if an error occurred. The form sits on the product page and redirects to another page when completed successfully. …
Marty Wallace
  • 5,631
  • 13
  • 65
  • 90
6
votes
2 answers

Where all controller frontnames are stored?

Suppose I've action URL abc/index/save and frontname abc is defined in my config file. When I hit abc/index/save it calls my action method. Where all frontname informations are stored? Does it searches for the given frontnames through config.xml…
amitshree
  • 7,006
  • 12
  • 63
  • 116
2
votes
2 answers

how to get current page url from controller

is this possible? I'm using one controller for (almost) the same functionality for two different pages. Is it possible to distinguish the source of the request in order to vary functionality? Note: This controller is used to process ajax calls.
easymoden00b
  • 1,277
  • 2
  • 26
  • 55
2
votes
1 answer

pass parameter to controller

Is it possible in magento to send parameter to controller form? $x=987654; $url=Mage::helper("adminhtml")->getUrl("/label/setlabel"); $block->addButton('label', array( "label" => "Get Label", …
user6398
  • 145
  • 3
  • 13
1
vote
2 answers

Get limit in a module controller

I'm newbie with Magento and I need something that probably it's very stupid. In a custom module I've got a controller and in that controller I want to read a variable. This variable is the products per page number. Does anybody know which helper or…
Jon Zangitu
  • 187
  • 1
  • 6
1
vote
4 answers

Controller override code doesn't execute

I need to override a controller (../Mage/Customer/controllers/AccountController.php) in order to enable user to upload a photo from "Account Information" form. I've manually created "photo" file upload field and added "enctype=multipart/form-data"…
Alan
  • 927
  • 1
  • 18
  • 33
1
vote
1 answer

Specifying /Controller vs. /controllers in config.xml

How do you specify that you want to use the /Controller folder instead of the /controllers folder within config.xml?
user2045
  • 831
  • 3
  • 16
  • 29
1
vote
2 answers

Is it ever ok to use "echo" in controllers? What's the Magento way?

A lot of Magento tutorials are using echo to output controller text. However, using echo can cause weird problems, like the infamous “Headers already sent” error. I understand that the right way to return response is by using setBody(), eg…
Ronen Ness
  • 587
  • 6
  • 19
0
votes
1 answer

core controller not overidden

I want to override Mage_Sales_Recurring_ProfileController in my custom module. My /etc/config.xml
Manashvi Birla
  • 8,833
  • 9
  • 27
  • 53
0
votes
1 answer

file_get_contents: failed to open stream

I'm trying to read a txt file with a controller that i've set up. However, I'm unsure where to place this file and how to call it correctly. Everything i've tried has resulted in the following error: 2015-01-21T13:57:02+00:00 ERR (3): Warning: …
easymoden00b
  • 1,277
  • 2
  • 26
  • 55
0
votes
1 answer

Question about controllers

I am on Magento 2.1 and I have looked all over and cannot find how to accomplish what I'm looking for. I've followed a few guides (http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/ etc) on how to create basic controllers and I…
tadmin
  • 21
  • 1
  • 2
-4
votes
1 answer

New block in custom module from controller not loading

I'm making a new page controller in my store, but the current configuration does not load the new block on the page. What is the probable error? And yes, I cleared the cache, and are disabled. The referent of my config.xml code is: