You should return a json encoded text in your controller.
The view layer is skipped.
Then let the javascript insert the list elements by manipulating the
DOM.

cheers
Massimiliano

On 27 Apr, 16:37, Tofuwarrior <p...@clearintent.co.uk> wrote:
> Ho Both,
>
> Thanks for your thoughts on this.
>
> If you can spare the time, I have one further question about this
>
> I am currently returning the <ul> that the tree menu function needs
> from the action which calls a fetchTree function which is currently in
> the model. This was just for development purposes and I can see I
> shouoldn't be writing html in the model -  I need to put it in the
> appropriate place. The function grabs the child folders and child
> files for the given parent and then writes the <ul> on this basis.
>
> What is the best way to separate this out in symfony - do I need to
> use a helper for this, maybe a partial? ( I don't yet fully understand
> these and when they should be used. ) and then pass the child folders
> and files to this which can output the html that is returned to the
> ajax function ?
>
> My assumption is that I should grab the child objects in the action by
> calling peer methods, assign them as variables and then call something
> that will take these values and output the <ul> which is then returned
> by the action to the ajax.
>
> Thanks,
>
> Paul
>
> --
> 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 
> athttp://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

Reply via email to