With the following structure for example
- frontend
-----module1
-----module2
- backend
----module1
----module2
- models
--- user
--- acl
--- etc
.index.php (for frontend by default)
.backend.php
you needn't to modify the dispatcher , just configure le router with the
right module directory/area.
And if really separate controllers form models, you just have to pick the
right model in models directory
angelbit wrote:
>
> yes, very well. i'm separe the admin section from public with htaccess and
> then extend standard dispath for modify simply the classToFilename
> function to read the admin files (with Admin_ prefix) controllers or don't
> remember...exists a function for custom prefix file controller?
> no good?
>
> jenreve wrote:
>>
>> Hi,
>>
>> maybe you could separate your bootstrap in two files (frontend/backend
>> ).
>> In your htaccess you can route to backend file if admin (or whatever )
>> is in the path.
>>
>> To my mind, it's better to separate admin and frontend config
>>
>>
>>
>>
>> angelbit wrote:
>>>
>>> admin is not a mobule but a container for modules...
>>>
>>> keith Pope-4 wrote:
>>>>
>>>> Sounds like you need to add a route, maybe something along the lines
>>>> of:
>>>>
>>>> $router = $this->_front->getRouter();
>>>>
>>>> // Admin route
>>>> $route = new Zend_Controller_Router_Route(
>>>> 'admin/:controller/:action',
>>>> array(
>>>> 'action' => 'index',
>>>> 'controller' => 'admin',
>>>> 'module' => 'admin'
>>>> )
>>>> );
>>>>
>>>> $router->addRoute('admin', $route);
>>>>
>>>> This should route anything that matches /admin to your admin module.
>>>>
>>>> 2008/12/14 angelbit <angelbit88@gmail.com>:
>>>>>
>>>>> Hi
>>>>> I'm developing a cms where the modules have controller for the admin
>>>>> section
>>>>> and the public section.Now need that when the user go on url:
>>>>> /admin/:module/:controller/:action the dispatcher load the admin
>>>>> controller
>>>>> (Admin_pageController.php for example) and when is the public
>>>>> url(:module/:controller/:action) the dispatcher load the public
>>>>> controller.
>>>>> how? subclass the dispatcher or else?
>>>>>
>>>>> I thank you in advance
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/CMS-supermodule-design-tp21000480p21000480.html
>>>>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> ----------------------------------------------------------------------
>>>> [MuTe]
>>>> ----------------------------------------------------------------------
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/CMS-supermodule-design-tp21000480p21001441.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论