Re: [fw-general] Extensible web admin

2014-06-06 Thread Emmanuel Bouton
Thanks a lot for all your responses !
SpiffyNavigation + use of placeholders seems to fit perfectly to my need.
Let's dig into that :)


2014-06-06 12:28 GMT+02:00 Stefano Torresi :

> you can use Zend\Navigation or, even better, Spiffy Navigation (
> https://github.com/spiffyjr/spiffy-navigation).
>
> just register a navigation instance as a service and have it composed by
> modules configuration, or decorate it in your modules via the service
> manager.
>
> for other templating stuff, i would suggest a full set of placeholders in
> a master layout, which your users can then manipulate in their own layouts,
> via view helpers or output capture.
>
> Stefano Torresi
> Web Developer
>
>
> 2014-06-06 10:25 GMT+02:00 Wojciech Nowogrodzki :
>
>>  Hi,
>>
>> One of the solutions could be create service i.e.
>> MyAwesomeAppPluginManager with methods: navAdd(), navGet(), navGetAll(),
>> navExist(), etc...
>>
>> Let's assume that navGetAll() will return an array of added options i.e.:
>> array(
>> 0 => array('url' => 'http://domain/first_url', 'name' => 'Super cool
>> link from 1st plugin'),
>> 1 => array('url' => 'http://domain/second_url', 'name' => 'Another
>> awesome link from 1st plugin')
>> )
>>
>> Then you can inject this array to your view as $pluginsMenuOptions:
>>
>> 
>> 
>> Home
>> First link
>> Second link
>> 
>> > echo $pluginMenuOption['name'] ?>
>> 
>> 
>> 
>>
>> After that you or someone else can create a plugin (i.e. external library
>> module). In Module.php method onBootstrap() one gets service
>> 'MyAwesomeAppPluginManager' and sets navigation options by calling navAdd()
>> method...
>>
>> Of course service 'MyAwesomeAppPluginManager' could also manage another
>> aspects of system (not only menu options).
>>
>> That was my firstthought how it could be solved.
>>
>>
>> W dniu 06.06.2014 10:01, Emmanuel Bouton pisze:
>>
>>  Hello,
>>>
>>> I'm working on a web admin interface with Zend Framework 2, and I'd like
>>> to
>>> make it extensible by « plugins ». Great for me ZF2 provides a great
>>> modules system :)
>>> But I wonder how I could make « cleanly » my templates extensible.
>>>
>>> Example :
>>>
>>> My « core » admin would render that :
>>>
>>> 
>>>  
>>>  Home
>>>  First link
>>>  Second link
>>>  
>>> 
>>>
>>> And I want that people could develop modules that could add links to my
>>> main menu :
>>>
>>> 
>>>  
>>>  Home
>>>  First link
>>>  Second link
>>>  Super cool link from 1st plugin
>>>  Another awesome link from 1st plugin
>>>  Great link from 2nd plugin
>>>  
>>> 
>>>
>>> How can I manage that in my core views / controllers ?
>>>
>>> Thanks,
>>> Best regards,
>>> Emmanuel
>>>
>>>
>> --
>> *Wojciech Nowogrodzki*
>>
>
>


Re: [fw-general] Extensible web admin

2014-06-06 Thread Stefano Torresi
you can use Zend\Navigation or, even better, Spiffy Navigation (
https://github.com/spiffyjr/spiffy-navigation).

just register a navigation instance as a service and have it composed by
modules configuration, or decorate it in your modules via the service
manager.

for other templating stuff, i would suggest a full set of placeholders in a
master layout, which your users can then manipulate in their own layouts,
via view helpers or output capture.

Stefano Torresi
Web Developer


2014-06-06 10:25 GMT+02:00 Wojciech Nowogrodzki :

> Hi,
>
> One of the solutions could be create service i.e.
> MyAwesomeAppPluginManager with methods: navAdd(), navGet(), navGetAll(),
> navExist(), etc...
>
> Let's assume that navGetAll() will return an array of added options i.e.:
> array(
> 0 => array('url' => 'http://domain/first_url', 'name' => 'Super cool
> link from 1st plugin'),
> 1 => array('url' => 'http://domain/second_url', 'name' => 'Another
> awesome link from 1st plugin')
> )
>
> Then you can inject this array to your view as $pluginsMenuOptions:
>
> 
> 
> Home
> First link
> Second link
> 
>  echo $pluginMenuOption['name'] ?>
> 
> 
> 
>
> After that you or someone else can create a plugin (i.e. external library
> module). In Module.php method onBootstrap() one gets service
> 'MyAwesomeAppPluginManager' and sets navigation options by calling navAdd()
> method...
>
> Of course service 'MyAwesomeAppPluginManager' could also manage another
> aspects of system (not only menu options).
>
> That was my firstthought how it could be solved.
>
> W dniu 06.06.2014 10:01, Emmanuel Bouton pisze:
>
>  Hello,
>>
>> I'm working on a web admin interface with Zend Framework 2, and I'd like
>> to
>> make it extensible by « plugins ». Great for me ZF2 provides a great
>> modules system :)
>> But I wonder how I could make « cleanly » my templates extensible.
>>
>> Example :
>>
>> My « core » admin would render that :
>>
>> 
>>  
>>  Home
>>  First link
>>  Second link
>>  
>> 
>>
>> And I want that people could develop modules that could add links to my
>> main menu :
>>
>> 
>>  
>>  Home
>>  First link
>>  Second link
>>  Super cool link from 1st plugin
>>  Another awesome link from 1st plugin
>>  Great link from 2nd plugin
>>  
>> 
>>
>> How can I manage that in my core views / controllers ?
>>
>> Thanks,
>> Best regards,
>> Emmanuel
>>
>>
> --
> *Wojciech Nowogrodzki*
>


Re: [fw-general] Extensible web admin

2014-06-06 Thread Wojciech Nowogrodzki

Hi,

One of the solutions could be create service i.e. 
MyAwesomeAppPluginManager with methods: navAdd(), navGet(), navGetAll(), 
navExist(), etc...


Let's assume that navGetAll() will return an array of added options i.e.:
array(
0 => array('url' => 'http://domain/first_url', 'name' => 'Super 
cool link from 1st plugin'),
1 => array('url' => 'http://domain/second_url', 'name' => 'Another 
awesome link from 1st plugin')

)

Then you can inject this array to your view as $pluginsMenuOptions:


Home
First link
Second link

echo $pluginMenuOption['name'] ?>





After that you or someone else can create a plugin (i.e. external 
library module). In Module.php method onBootstrap() one gets service 
'MyAwesomeAppPluginManager' and sets navigation options by calling 
navAdd() method...


Of course service 'MyAwesomeAppPluginManager' could also manage another 
aspects of system (not only menu options).


That was my firstthought how it could be solved.

W dniu 06.06.2014 10:01, Emmanuel Bouton pisze:

Hello,

I'm working on a web admin interface with Zend Framework 2, and I'd like to
make it extensible by « plugins ». Great for me ZF2 provides a great
modules system :)
But I wonder how I could make « cleanly » my templates extensible.

Example :

My « core » admin would render that :


 
 Home
 First link
 Second link
 


And I want that people could develop modules that could add links to my
main menu :


 
 Home
 First link
 Second link
 Super cool link from 1st plugin
 Another awesome link from 1st plugin
 Great link from 2nd plugin
 


How can I manage that in my core views / controllers ?

Thanks,
Best regards,
Emmanuel



--
*Wojciech Nowogrodzki*