Andy Wardley <[EMAIL PROTECTED]> writes:

> On Tue, Oct 23, 2001 at 01:16:40PM +0200, Jonas Liljegren wrote:
> > Would there be an intrest of a patch for using print, if availible, in
> > the construction of the compiled template if the returned value from
> > the stash get() is an object?
> 
> That would cause problems with this:
> 
>    [% foo = bar %]       
>    [% foo.method %]
> 
> If bar is an object then the first line should set foo to reference the 
> same object so that the second line works properly.  However, your proposal
> would cause foo to receive the output of bar->print().

No.  That's not how I intended it to work.  I'm not very familiar with
the code.  But I would like to insert the the check/filter in the last
stage.  Consider thish generated code:

$output .=  "\"\n         maxlength=\"";
$output .=  $stash->get('maxlength');
$output .=  "\"\n  >\n";

Just took some code from a ttc file.  Pretend that maxlength is/returns
an object.


I would like to change the generated code to this:

$output .=  "\"\n         maxlength=\"";
$output .=  last_filter( $stash->get('maxlength') );
$output .=  "\"\n  >\n";


I don't think there is a problem with this because we know that the
output is supposed to be a string.  It will never be an object, or ref
of any sort.


And this inserted filter would also allow for a default filter on the
value.


We could have an configuration option for keeping the old behaviour
and performance.

-- 
/ Jonas  -  http://jonas.liljegren.org/myself/en/index.html


Reply via email to