Hi there,

OK here is an example, supose that i havethe next HTML:

...
...
<div id="days">01</div>
...
...
<!--A lot of html here-->
...
...
<div id="total">$100</div>
...
...
<a onclick="calculate()">Calculate</a>
...
...

Now, when some user clicks over "Calculate" link the app ill make an
ajax call to my controller's "foo", this ajax call needs to render the
"total" and "day" divs in my html. Noe as you see those divs are two
"separated" from ech other so i can not just make a partial that
contains:

..
...
<div id="days"><?php echo $amount?></div>
...
...
<!--A lot of html here-->
...
...
<div id="total"><?php echo $days?> </div>
...
...
is just a lot of html in that partial that i do not need to render via
ajax... and i can not create a partial with just the 2 divs i need
because they are in two different places totally different.
Thats why i am asking is there is any form of rendering multiple
partials from an action, so i can create one partial that contains(for
example) the "days" div, another partial that contains the "amount"
div and just render those. so my controller may look like

public function foo()
{
     $foo = 25;
     $foo2 = 300;
     return $this->renderPartial('myPartial1', array("days" => $foo));
     return $this->renderPartial('myPartial2', array("amount" =>
$foo));
}

Ay idea?

Cheers

On 3 jun, 12:37, Donald Tyler <chekot...@gmail.com> wrote:
> I'm not completey understanding what you're trying to accomplish.
>
> When you say Ajax call from a controller, what exactly do you mean? It
> doesn't sound like you're talking about a typical ajax request from a
> browser.
>
> On Thursday, June 3, 2010, fRAnKEnSTEin <shirkav...@gmail.com> wrote:
> > Hi,
>
> > is there any way to render multiple partials with an ajax call from a
> > controller? the problem that i am having is that i need to refresh
> > after the ajax call, segments of html that are in differentes
> > separated parts of the dom, so i can not create a partial with this
> > elemets inside(because that will force me almost to create a partial
> > with al the <body> inside XD)
>
> > I think rendering multiple partials could solve may problem..but not
> > sure if this is the right aproach..
>
> > Any idea?
>
> > Cheers
>
> > --
> > 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

-- 
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