Re: Smarty setting arrays

From: Date: Thu, 01 Nov 2001 11:47:53 +0000
Subject: Re: Smarty setting arrays
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1778@lists.php.net to get a copy of this message
I found the error of > {assign var="thing" value="666"} > {insert name="form" element=$thing} Now everything works fine. Was the follow error: I eval in Smarty_Compiler.class an $this that should be object of Smarty.class So, at function _compile_template that call the Compiler.class I add: $smarty_compiler->smarty = $this; And with a simple substituion of $this-> to $this->smarty-> every The complete fix I'm sending attached. Atenciosamente, Roberto Berto' ---------------- roberto@berto.net eConsultor 0(XX)51 32270599 -> Horario preferencial: 13h - 20h 0(XX)51 91169628 -> Em outros horarios ----- Original Message ----- From: "Roberto Berto" <roberto@berto.net> To: <smarty@lists.ispi.net> Sent: Thursday, November 01, 2001 8:00 AM Subject: Smarty setting arrays > I developed a routine and send it to Monty and Andrei. > > The functions strip strings and make arrays from it. Like this: > {command users@name="Roberto" users@age="18" options@city@NY="0" > options@city@Chicago="1"} come > > $users = array("name" => "Roberto", "age" => > "18"); > > $options = array("city" => array("NY"=>0,"chicago"=>1)); > > I use this with "insert" functions, but now I added to "custom" functions > too and maybe Andrei or Monte can add this string to array in others things > of Smarty like: insert, custom functions, assign. > > With insert and custom functions are easy. But with assign to string we'll > use {assign val="some" and value="me"} but with arrays we need to change to > {assign array="some" something@foo="123" other@foo@me="666"} > > > Now, I need to ask: > Vars doesnt work with {insert}? > > I try: > > {assign var="thing" value="666"} > {insert name="form" element=$thing} > > And doesnt work. > > Why? > > > > and I think they > > Atenciosamente, > > > Roberto Berto' > ---------------- > roberto@berto.net > > eConsultor > > 0(XX)51 32270599 -> Horario preferencial: 13h - 20h > 0(XX)51 91169628 -> Em outros horarios > > >

Attachment: [application/octet-stream] Smarty_Compile.class.php
« previous php.smarty.general (#1778) next »