[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    Re: [SMARTY-DEV] object registration committed
From:       Monte Ohrt <monte () ispi ! net>
Date:       2003-01-24 15:09:06
[Download RAW message or body]

Object registration now follows this format in CVS:

index.php
---------
$smarty->register_object('foo', $myobj); // smarty arg format
$smarty->register_object('foo', $myobj, false); // one param per arg

index.tpl
---------
{foo->bar p1="foo" p2="bar"}

If the given name does not exist as a method, it will be treated as a
property. If a method and property exist of the same name, the method
will be used.

Monte

> 
> I agree with this.  Using '->' for objects makes it easier to see which is
> which and might even make things easier to explain to the template designer.
> For instance an methode of an object can take params and an array can't. The
> difference might be hard to explain
> Example:
> {$object.Methode p1=2 p2=23} works
> {$array.Element p1=1 p2=23}  doesn't work (or not as expected ;-) )
> 
> Greetings,
> Jan Rosier
> 
> The best way to predict your future is to create it.
-- 
Monte Ohrt <monte@ispi.net>


-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic