|
|||
|
I'm trying to figure out how to create plugins. I've read the piece in the Zend Framework documentation on it, but it doesn't seem to be working. I don't know if I need to use both setControllerDirectory() and addControllerDirectory() in the Front object to register my plugin? When I try to access /plugin/controller/action It can't find plugin controller. But it's not a controller, it's a module.
Any tips? Thanks, |
|
|||
|
I guess I was confusing plugins with modules. I'm use to cakephp which calls their modules plugins, and it appears that what is a plugin for Zend is a component for cakephp? Anyways, I'm trying to figure out how to use modules. I was able to access the path of my MVC module for the controller, but not when I do a /module/controller/action only when I do a /controller/action
Anyone know what I'm missing? |
|
|||
|
I was able to figure out that I needed to add my module to my config file so it knows the routes. What I'm wondering now, is there a way for it to find my modules models, and views automatically? Or, do I need to always tell it the whole path to find where they are located when I'm trying to render the views or access the models?
|
|
|||
|
When you use render() zend will automaticly search for /views/scripts/actionname/actionname.phtml
But, you can use custom locations or you can add directories where zend view has to look for the controllers like this: PHP Code:
I've tried to make the same thing as you are trying now, and it didn't work for me I'm not using the multiple controllers because I wasn't able to render my header and footer.phtml and had no idea how to fix it. I hope you have more luck or just more skill ![]() Last edited by SpotSec : 05-02-2007 at 05:49 AM. |
|
||||
|
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
|||
|
Quote:
|
|
||||
|
Quote:
I think most of this is documented in fine print somewhere in the manual, but hey, this forum is here to help any little problem or misunderstanding . Probably not to the point of doing your project for you but its worth a try asking ain't it? :P
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog Last edited by SpotSec : 05-02-2007 at 05:50 AM. |
|
|||
|
Thanks for all the comments. I have another issue I'm running into. I'm use to CakePHP where I can have so called modules, that include everything for that module to operate, such as css, images, javascript directories. So I can slap a module in (called plugin in cakephp) and it works right away without modifying routes, telling things where to find stuff, ect.
Is there a way to have Zend Framework modules be able to encapsulate the css, img, js directories right in the module so if I move it or put it in a different application I won't need to copy the css, img, js into the document_root of the main Framework application? |
|
||||
|
As far as interchangeable modules go, it won't work without modification. And yes you can have modules in the document_root, but this is not a recommended setup as it exposes your webapp to everyone. You could do this and have some sort of acl or .htaccess setup to deny access to the controllers etc...
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
|||
|
Yeah, I wouldn't ever want my modules in the document_root. I just didn't know if the other directories that are normally in the doc_root, could be placed in the module directory. Oh well. I wish they had a way to do this, because I see it as a real disadvantage. I can somewhat see why they would want it to just use the css that is with the main application to easily incorporate the look and feel, but for javascript and images for the module, this is a poor design. And even if it is using the css of the main application, there are going to be css issues where the module will need to have its own styles to make things look right.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|