Zend Framework 2 - Vendor package question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend Framework 2 - Vendor package question

Jhon
This post has NOT been accepted by the mailing list yet.
I am working for some time on Zend Framework 2 and everything is pretty fun and cool. Now I am trying to make something like can be made in Magento pretty easy ( extensions ) that will help develop on new ZF2 project. Is it possible to make a vendor package that can have n extension ( like submodules ) items and be plugged in the main modules and just add components in a way for the view, routes, etc.. something like Magento extensions system. Is it possible? Is there a good point to start from to achieve this?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Zend Framework 2 - Vendor package question

Marco Pivetta
Hi Jhon,

On 23 October 2014 15:17, Jhon [via Zend Framework Community] <[hidden email]> wrote:
I am working for some time on Zend Framework 2 and everything is pretty fun and cool. Now I am trying to make something like can be made in Magento pretty easy ( extensions ) that will help develop on new ZF2 project. Is it possible to make a vendor package that can have n extension ( like submodules ) items and be plugged in the main modules and just add components in a way for the view, routes, etc.. something like Magento extensions system. Is it possible? Is there a good point to start from to achieve this?

Did you look at the modules system? And composer? That's pretty much all you need :-)
Reply | Threaded
Open this post in threaded view
|

Re: Zend Framework 2 - Vendor package question

Jhon
This post has NOT been accepted by the mailing list yet.
In reply to this post by Jhon
Hello Marco, thank you for the response.
Yes I have learned about the module system, and please do correct me if I am wrong, in every module you can encapsulate a lot of functionality, but I was thinking like this, almost every application will need a front module to be visible to the user and a module for the admin, they will not interact, every module has its own set of rules to achieve.
But is there a method to make a module/library to inject in both modules different behaviour? ( example: I want at one point to add a simple checkout, in admin I want to have a page where I can make some settings for that checkout and in the front the checkout page. Is it not better and quicker to make a package that will run on every zf2 project if they have some required refferences ( admin and front ) with own views or view blocks, own route instead of merging new config with old one, transfer the controller, model and view you need in the new project? Or this is possible in zf2 and I have to learn and read more?

Thank you again and please excuse me if the question is stupid, I have much more to learn about ZF2.
Reply | Threaded
Open this post in threaded view
|

Re: Zend Framework 2 - Vendor package question

Marco Pivetta
Hey Jhon,

On 23 October 2014 21:49, Jhon [via Zend Framework Community] <[hidden email]> wrote:
Hello Marco, thank you for the response.
Yes I have learned about the module system, and please do correct me if I am wrong, in every module you can encapsulate a lot of functionality, but I was thinking like this, almost every application will need a front module to be visible to the user and a module for the admin, they will not interact, every module has its own set of rules to achieve.

Modules are *NOT* sections of a website. Modules are reusable components that provide settings/services and in general functionality in a ZF2 application.

A module may, in its general form, be anything. Separating modules by site sections is generally a mistake, as an "admin" and a "frontend" page may rely on the same service logic.
 
But is there a method to make a module/library to inject in both modules different behaviour? ( example: I want at one point to add a simple checkout, in admin I want to have a page where I can make some settings for that checkout and in the front the checkout page. Is it not better and quicker to make a package that will run on every zf2 project if they have some required refferences ( admin and front ) with own views or view blocks, own route instead of merging new config with old one, transfer the controller, model and view you need in the new project? Or this is possible in zf2 and I have to learn and read more?

You can just keep different configs for admin and frontend views. You don't need to "replace" URLs in your application to make them "admin" or "frontend" depending on a config setting: just use different URIs.

Reply | Threaded
Open this post in threaded view
|

Re: Zend Framework 2 - Vendor package question

Jhon
This post has NOT been accepted by the mailing list yet.
Hello Marco,

Thank you for the clarifications, I will get back in the books and code practicing. From you answers it seems I misunderstood how the framework should really be used.