|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
OneTwo Smarty n00b
Joined: 01 Mar 2005 Posts: 2
|
Posted: Tue Mar 01, 2005 2:36 pm Post subject: objekte zur laufzeit registrieren |
|
|
wie kann man by smarty objekte zur laufzeit registrieren?
Bsp.:
template:
{ irgendeineFuktion assig="einObjekt" }
{ einObjekt->function }
//
in der Funtion "irgendeineFuktion" wird ein objekt erstellt und soll dann im template zur verfügung stehen.
Wie geht das?!? |
|
Back to top |
|
OneTwo Smarty n00b
Joined: 01 Mar 2005 Posts: 2
|
Posted: Tue Mar 01, 2005 4:37 pm Post subject: |
|
|
habs selber gelöst, die frage ist nur, ob es wirklich so sauber ist?!?
hab eine compiler plugin gemacht, in der ich die register_object methode von dem compliler objekt verwende. dort erstelle ich nur sozusagen die objekt hülle, damit smarty beim parsen keine probleme bekommt, mit inhalt wird das objekt ert an der stelle gefüllt, wo es benötigt wird, wo ich dann die methode get_registert_object( "name des objektes" ) verwende, da ich nun eine referenz bekomme, kann ich einfach das selbe objekt entweder noch mal neu generieren oder wenn das objekt ein interface hat, sich selbst zu befüllen dann dies anwenden.
hat jemand noch ne andere idee?!? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|