Difference between assigns and registers?

40 views
Skip to first unread message

subimage interactive

unread,
Jan 27, 2008, 11:17:19 PM1/27/08
to liquid-t...@googlegroups.com
Sorry for all the really stupid questions lately...but, here's another one :)

What's the difference between assigns and registers when rendering a template? From what I grok, assigns are basically variables that are accessable in the template itself, and registers are accessable from the drops/filters/tags?

Is this somewhat on point, or am I missing it?

--
--------------------
seth at subimage interactive
-----
http://sublog.subimage.com
-----
Cashboard - Estimates, invoices, and time tracking software - for free!
http://www.getcashboard.com
-----
Substruct - Open source RoR e-commerce software.
http://dev.subimage.com/projects/substruct

subimage interactive

unread,
Jan 29, 2008, 12:52:49 AM1/29/08
to liquid-t...@googlegroups.com
Anyone care to chime in on this one? :)

subimage interactive

unread,
Jan 29, 2008, 4:42:04 AM1/29/08
to liquid-t...@googlegroups.com
Ok, found something that cleared it up for me.

You notice that I pass Liquid two other items. assigns is a hash of available variables, objects or drops that the template can reference. registers is a hash of variables that are accessible from Drops, Tags, and Filters. Think of assigns as exposed to the template, andregisters only used within the back-end processing of the template.

subimage interactive

unread,
Jan 29, 2008, 4:49:49 AM1/29/08
to liquid-t...@googlegroups.com
Perhaps add this to the Wiki? :)

roy kolak

unread,
Jan 30, 2008, 1:36:28 AM1/30/08
to Liquid Templates
Nice link. Guides / advanced topic explanations are tough to come by
with Liquid.

On Jan 29, 3:49 am, "subimage interactive" <subim...@gmail.com> wrote:
> Perhaps add this to the Wiki? :)
>
> On Jan 29, 2008 1:42 AM, subimage interactive <subim...@gmail.com> wrote:
>
>
>
> > Ok, found something that cleared it up for me.
> > You notice that I pass Liquid two other items. assigns is a hash of
> > available variables, objects or drops that the template can reference.
> > registers is a hash of variables that are accessible from Drops, Tags, and
> > Filters. Think of assigns as exposed to the template, andregisters only
> > used within the back-end processing of the template.
>
> >http://www.simplechatter.com/archives/2007/8
>
> > On Jan 28, 2008 9:52 PM, subimage interactive <subim...@gmail.com> wrote:
>
> > > Anyone care to chime in on this one? :)
>
> > > On Jan 27, 2008 8:17 PM, subimage interactive <subim...@gmail.com>
> -----http://sublog.subimage.com
> -----
> Cashboard - Estimates, invoices, and time tracking software - for free!http://www.getcashboard.com
Reply all
Reply to author
Forward
0 new messages