Thanks Both, no point in making things harder if symfony gives you the tools especially if javsacript is not a strong one which for me it isn't so i like the partial example, that was what I was after - understanding how to link the symfony elements together to make it nice and neat.
Really appreciate your insights. On 29 April 2010 14:36, Gareth McCumskey <gmccums...@gmail.com> wrote: > I know you are talking about ajax. So, for the sake of brevity< i > include an example of the way it could be done in symfony 1.0 using > the helpers: > > In a template: > > <?php echo link_to_remote('Link text', array( > "url"=>"module/action", > "update"=>"div_to_update" > )) > ?> > > <div id='div_to_update'></div> > > In actions.class.php > > public function executeAction(sfWebRequest $request) > { > //Run whatever model class methods to get data you need > //and store that in an array eg: > $this->array_to_use = ModelNamePeer::getDataArray(); > > //Render to a partial > $this->renderPartial('partialName'); > } > > > Now in _partialName.php: > > <ul> > <?php foreach ($array_to_use as $array_item): ?> > <li><?php echo $array_item ?></li> > <?php endforeach; ?> > </ul> > > That partial would display within the div_to_update div in the > template and is ajax. > > On Thu, Apr 29, 2010 at 3:27 PM, Massimiliano Arione <garak...@gmail.com> > wrote: > > On 29 Apr, 09:17, Gareth McCumskey <gmccums...@gmail.com> wrote: > >> Or return an array from the action to the template/partial and have php > do: > >> > >> <ul> > >> <?php foreach ($array as $array_item): ?> > >> <li><?php echo $array_item ?></li> > >> <?php endforeach; ?> > >> </ul> > > > > We're talking about ajax. > > You just can't output any html anywhere, unless you want to use ugly > > innerHTML js function. > > > > cheers > > Massimiliano > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > > http://groups.google.com/group/symfony-users?hl=en > > > > > > -- > Gareth McCumskey > http://garethmccumskey.blogspot.com > twitter: @garethmcc > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en