[FLOW3-general] Interaction between two or more Packages
Thomas Layh
thomas at layh.com
Thu Jan 19 11:05:38 CET 2012
I am currently not sure if my following answer is what you asked.
What I have done with my fugrm-packages, I have written an abstract
controller that is overwriting the template path. So my layout template is
stored in the base package. The partials are free to use everywhere, but
you have to specifiy a longer path in the template. This way the second
package is using the layout from the base package. The navigation partial
for example is also from the base package.
The second package (the controller) is extending the abstract controller
from the base package and has the layout path from the base package.
Getting the correct repository shouldn't be a problem, no matter in which
package you are at the moment.
Just take a look at the following three links. I am not sure if this is
what you asked, but this is what I understood.
Here you can see how I overwrite the template pathes.
https://gitorious.org/fugrm/fugrm-base/blobs/master/Classes/Controller/AbstractController.php
Here I extend the controller from the base package
https://gitorious.org/fugrm/fugrm-gallery/blobs/master/Classes/Controller/GalleryController.php
Here I use the full pathes to the partial. If you do it this way, you have
also to define the package when you include you css and js in the layout
file.
https://gitorious.org/fugrm/fugrm-base/blobs/master/Resources/Private/Layouts/Index.html
There is always a initialize<yourActionName>Action for each of your action.
I guess in your case it would be nice to also initialize the view depending
on the current action, but I can not find something like that in the FLOW3
action controller.
Hope this helps or did I completely misunderstood your question?
Greetings,
Thomas
On Thu, Jan 19, 2012 at 10:41, Daniel Felix <d.felix at codeworkz.net> wrote:
> Ah okay. Thank you Thomas!
>
> Do you also have some solution for my problem with the package interaction.
> The example for using two repositories / models in one template / view.
>
> Example:
> Get users from repo 1 in package 1 and show them in the template which is
> in package 3.
> Also add the blogs from repo 2 and package 2?
>
> So that package 3 works like a manager/controller for all packages?
>
> Thanks in Advance,
> Daniel
>
> Am 19.01.2012 um 08:30 schrieb Thomas Layh <thomas at layh.com>:
>
> > Hi Daniel,
> >
> > you can add the package to your Fluid action links and in this way you
> can
> > link from one package to another. I used this a while ago for the
> Usergroup
> > website and it works well.
> >
> >
> https://gitorious.org/fugrm/fugrm-base/blobs/master/Resources/Private/Partials/Navigation.html
> >
> >
> > Hope this helps.
> >
> > Greetings,
> > Thomas
> >
> > On Wed, Jan 18, 2012 at 18:05, Daniel Felix <d.felix at codeworkz.net>
> wrote:
> >
> >> Hey there,
> >>
> >>
> >>
> >> is there any defination for interactions between two packages?
> >>
> >>
> >>
> >> Some example:
> >>
> >> 1 Package for Usermanagement (LoginController, RegistrationController,
> >> UserModel, UserRepository, .)
> >>
> >> 1 Package for a Blog (BlogController, BlogModel, BlogRepository, . etc.)
> >>
> >> 1 Package for some Articledatabase (same as above)
> >>
> >>
> >>
> >> Now the interaction examples:
> >>
> >> A user register and should be added to the userrepository. If his
> usergroup
> >> matches, he should be able to add some article to the articlerepository.
> >>
> >>
> >>
> >> Or another example:
> >>
> >> A user read some articles from the articlerepository. On the same page,
> he
> >> should see the last 5 blogs from the blogrepository.
> >>
> >>
> >>
> >> Is there any dynamic way to define this with some packages and link them
> >> together to one application or do I have to write this all in one
> package
> >> to
> >> have a functional application.
> >>
> >>
> >>
> >> I would prefer the first way, to reuse the packages itself in some other
> >> projects.
> >>
> >>
> >>
> >> I've read your documentation but couldn't find some good example for
> this
> >> situation.
> >>
> >>
> >>
> >> Best regards
> >>
> >> _______________________________________________
> >> FLOW3-general mailing list
> >> FLOW3-general at lists.typo3.org
> >> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> >>
> > _______________________________________________
> > FLOW3-general mailing list
> > FLOW3-general at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
More information about the FLOW3-general
mailing list