M
M
matveyboyko2016-02-24 12:59:13
Magento
matveyboyko, 2016-02-24 12:59:13

How to specify the full path to a file in Magento?

My module is located here: /app/code/local/MySpacename/MyModule.
This folder contains a file that I need to access via Ajax.
How can I specify the full path to this file?
No matter how you try, it doesn't work. Even manually wrote /app/code/local/MySpacename/MyModule/ajax.php.
Now, as a test, I posted it in /skin/ajax.php.
This way everything works. But this is not comme il faut.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Cherny, 2016-02-26
@paalomnik

it's bad practice to keep the file in a module and access it like ajax, it's better to make a method in the controller, then you can access it by url, if you still really want to push it into the module then
or
in both cases it will be necessary to add handles, but still I advise you to use the controller

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question