Lift is not a MVC framework but a View First one. Snippets are the way to generate dynamic content that will be woven into the resulting markup. There is no design break in fact it is one of the most fundamental design goals of Lift. Snippets work with markup building blocks to generate the proper outcome. This is not a bad thing, quite the opposite. However every framework out there can be used improperly in this case using tons of markup in the snippets doesn't make too much sense.
If you still feel that you want to make a comparison between Lift and MVC snippets are not controllers. You can think of snippets as rendering helpers that sits very close to the templates ... Static Templates + Snippets = Resulting Markup That Contains Dynamic Content Br's, Marius On Jul 22, 12:59 pm, José María <[email protected]> wrote: > Doesn't this put "view code" (XML/Xhtml) in controller code? I've read > many times > in Lift doc about not puting logic in view but the reverse can be > even > worst, doing impossible to have a separate design. You can't broke > logic but > design. > > On Jul 21, 10:19 am, Timothy Perrett <[email protected]> wrote: > > > José, > > > You'll need to do this from yoursnippetcode - we dont have any view > > logic in templates at all as that breaks lift view first model. > > > For example: > > > class YouSnippet { > > def example: NodeSeq = <a>Hi</a> % "href" -> "/mypath/" + > > someDynamicVar > > > } > > > In your template: > > > <lift:your_snippet.example /> > > > Does that make sense? > > > Cheers, Tim > > > On Jul 21, 10:11 am, José María <[email protected]> wrote: > > > > Hi, > > > > I suppose that this is something simple, how can I put a value inside > > > a property in a template? > > > > Something like: > > > > <a href="/mypath/<myobject:id></myobject:id>">hi</a> > > > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" 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/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
