Hi, Try item['value'] instead of item.value inside the php: block; the dot is translated as -> which would be incorrect as your value is an array element.
On 3/19/09, Daniel Lima <cont...@daniellima.info> wrote: > Hi, > > I have the follow PHP script: > > <?php > ... > $datagrid = new Cilens_Grid; > echo $datagrid.*resultsPerPage*; // 10, 20, 50 or 100..property set by > $_REQUEST. > $template->grid = $datagrid; > ... > ?> > --------------------------------------------------------------- > And a little part from my template code: > ...... > <select name="resultsPerPage" id="resultsPerPage"> > <option value="" > tal:repeat="item *grid/pager/viewOptions*" > tal:content="item/label" > tal:attributes="value item/value; *selected php: item.value > == grid.resultsPerPage*">100</option> > </select> > > The script runs normaly, the select options are filled with value and > option....., but it do not set *selected* property. > And the *grid.resultsPerPage* is realy correct, but it dont run in loop > scope. I got the follow error message: > > Notice</b>: Trying to get property of non-object in > <b>C:\WINDOWS\Temp\tpl_123742909 > > I tried: > *selected php: repeat.item.value == grid.resultsPerPage* > *selected php: item.value == grid.resultsPerPage* //as before > *selected php: item/value == grid.resultsPerPage* > *selected php: {item.value} == grid.resultsPerPage* > > And nothing, > > Note: the *grid/pager/viewOptions* is an array variable > > array(4) { > [0]=> > array(2) { > ["label"]=> > string(2) "10" > ["value"]=> > string(2) "10" > } > [1]=> > array(2) { > ["label"]=> > string(2) "20" > ["value"]=> > string(2) "20" > } > [2]=> > array(2) { > ["label"]=> > string(2) "50" > ["value"]=> > string(2) "50" > } > [3]=> > array(2) { > ["label"]=> > string(3) "100" > ["value"]=> > string(3) "100" > } > } > > Can you help me? > > Regards, > ....... > -- > Daniel Lima > Web Developer > -- -- Tjerk _______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal