Nicolas CHARLOT wrote: > Hadrien Boyé a écrit : >> Hi Nicolas, >> >> why do you want to generate an URL inside the model layer ? >> >> in the MVC architecture, the model must be independant from the way >> the layer is accessed. if you generate URL's inside the model layer, >> you broke that rule by stipulating that the application would be >> accessed by the web only. >> >> why don't you use the Controler layer, to generate url's inside >> actions methods ? > I agree with U but it's a bit particular since the app is a base of CMS. > > The model inherits form a node a main class and can be : > - a page > - a heading > - a link to an action > - a link > - a shortcut to another node > - a dynamic node > > There's a special getLink() method for each type of nodes. To avoid > implement complex logic in templates, I just call the method and the URL > is simply returned. >
You could just build a static class/object that takes as input the model and outputs a link... keeping it clean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
