[jifty-devel] Template::Declare Updates

David E. Wheeler david at kineticode.com
Mon Oct 5 20:56:38 EDT 2009

On Sep 8, 2009, at 8:45 PM, David E. Wheeler wrote:

>> May be for sake of consistency we should introduce new function
>> show_template and have the following
>> show - magic that dispatch to _page or _template
>> show_page - show exlcuding private
>> show_template - show including private
>> That will clear some confusion, I had that too at first.
> The terminology is bad, frankly. Are these really intended to be used
> in user-space? I know that show() dispatches to show_page() as
> appropriate, but is show_page() ever used by template authors or tag
> set authors?

I've added this:

=head2 show_page

     show_page( main => { user => 'Bob' } );

Like C<show()>, but does not dispatch to private templates. It's used
internally by C<show()> when when that method is called from outside a
template class.

I see that there is already a _show_template function, but it's  
interface is a bit different. I could create a wrapper named  
show_template() around it, so then we'd have the three functions you  
mention, but I still think that the names are terrible: you're not  
showing a page or a template, but wanting to show *from* a page or  
template -- where "page" means outside of a template class, and  
"template means inside of a template class. Correct?

If so, I find the terminology confusing. What is a "page"? If it's  
anything that's not a template, then maybe it should just be a  
non_template? how about

show_from_template() - includes private
show_not_from_template() - excludes private
show() - magic that dispatch to _page or _template

Terrible names, but maybe there's a better terminology we could use  



More information about the jifty-devel mailing list