o0ozinkyo0o Posted December 16, 2013 Share Posted December 16, 2013 Hi all, I'm writing a module in prestashop, and i want this module contain front controller and admin controller too because i have manage this module with account admin. In the case create controller in front folder, i create file MyModuleFrontController.php in mymodule/controller/front and used path is mysite.com/index.php?fc=module&module=mymodule&controller=MyModuleFrontController and ofcouse it's work good. But when i create controller in admin folder, and i do same above so it's not work, I don't find any way to run my admin controller of module. Can You help me. Thanks all and Have a nice day! Link to comment Share on other sites More sharing options...
vekia Posted December 16, 2013 Share Posted December 16, 2013 you want to use admin controller in front office? it's not possible hope that i understood you well Link to comment Share on other sites More sharing options...
o0ozinkyo0o Posted December 16, 2013 Author Share Posted December 16, 2013 well, You understood what i mean... And It's really impossible? Link to comment Share on other sites More sharing options...
vekia Posted December 16, 2013 Share Posted December 16, 2013 when you create front controller for your module you use this: class MyModuleModuleFrontController extends ModuleFrontController{ and when you create admin controller you use this: class MyModuleController extends ModuleAdminController { frontcontroller will not work with "extends ModuleAdminController" so it's not possible to use adminController in Front Link to comment Share on other sites More sharing options...
o0ozinkyo0o Posted December 17, 2013 Author Share Posted December 17, 2013 Hi Vekia, I found this link http://www.programmingtunes.com/prestashop-1-5-features-for-developers-part-1-modules/ talk about create admin module for module API, this is thing i need. "Now lets consider we want to create a controller for the admin section. Lets say we want the controller to be AdminFaqController, , so place a file in the /faq/controllers/admin/ and name is AdminFaqController.php . So the class code will be like class AdminFaqController extends ModuleAdminController { ...... ..... }" I go this step but i don't know how to path this controller in URL... I try mysite/index.php?fc=module&module=ptsmapi&controller=AdminFaq but it's not work... Can you check it to help me. Thanks so much. Link to comment Share on other sites More sharing options...
vekia Posted December 17, 2013 Share Posted December 17, 2013 you can't use adminController in frontController. if you want to use mysite/index.php?fc=module&module=ptsmapi&controller=AdminFaq you have to use FrontController, not admin. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now