Re: [fw-general] ZF2 Routing question

2013-07-19 Thread Ben Scholzen 'DASPRiD'
Apart from what Matthew already said, to answer the general question:
Yes. You can have the following in your admin module config:

return array(
'router' = array(
'routes' = array(
'admin' = array(
'type' = 'literal',
'options' = array('route' = '/admin'),
'may_terminate' = true, // if you want to allow this
)
),
)
);

and then in your other modules:

return array(
'router' = array(
'routes' = array(
'admin' = array(
'child_routes' = array(
// …
)
)
),
)
);

Those configs will eventually be merged by the module manager.

On 18.07.2013 22:21, Tomasz Kuter wrote:
 Hi all,
 
 I am working on own CMS system in Zend Framework 2.
 It means I will have frontend and backend site.
 
 I would like to have backend at following url:
 /admin
 
 In administration panel there will be a few sections at the beginning e.g.
 webpages, news, media.
 These sections will be available as follow:
 /admin/webpages
 /admin/news
 /admin/media
 
 Each section has many actions e.g. add, edit, delete.
 
 I would like to have following modules:
 1. admin (general functionality)
 
 2. website (webpages management)
 a) index controller (frontend)
 b) admin controller (backend)
 
 3. news (news management)
 a) index controller (frontend)
 b) admin controller (backend)
 
 4. etc
 
 Currently I have all admin routes in file
 /module/Admin/config/module.config.php
 
 Is there a possibility to keep main /admin route in mentioned file,
 and sections route (e.g. /admin/webpages) in separate modules?
 
 Thanks.
 
 --
 Regards,
 Tom Kuter
 


-- 
Ben Scholzen 'DASPRiD'
Community Review Team Member | m...@dasprids.de
Zend Framework   | http://www.dasprids.de

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] ZF2 Routing question

2013-07-18 Thread Matthew Weier O'Phinney
On Thu, Jul 18, 2013 at 3:21 PM, Tomasz Kuter evo...@interia.pl wrote:
 Hi all,

 I am working on own CMS system in Zend Framework 2.
 It means I will have frontend and backend site.

 I would like to have backend at following url:
 /admin

 In administration panel there will be a few sections at the beginning e.g.
 webpages, news, media.
 These sections will be available as follow:
 /admin/webpages
 /admin/news
 /admin/media

 Each section has many actions e.g. add, edit, delete.

 I would like to have following modules:
 1. admin (general functionality)

 2. website (webpages management)
 a) index controller (frontend)
 b) admin controller (backend)

 3. news (news management)
 a) index controller (frontend)
 b) admin controller (backend)

 4. etc

 Currently I have all admin routes in file
 /module/Admin/config/module.config.php

 Is there a possibility to keep main /admin route in mentioned file,
 and sections route (e.g. /admin/webpages) in separate modules?


There's a module for that: https://github.com/ZF-Commons/ZfcAdmin

Essentially, it allows you to define your admin controllers and views
in the modules in which the functionality is defined, but then tie
into a centralized admin interface via routing.



--
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com