Hello,
In your routing.yml, you can a this rule:
random_image:
url: /random.gif
param: { action: image, action: random }
And in your imageActions class:
public function executeRandom()
{
$this->getResponse()->setContentType('image/gif');
$im = imagecreatetruecolor(100, 100);
imagegif($im);
imagedestroy($im);
exit;
}
On Thu, Oct 22, 2009 at 2:16 PM, Sameer I <[email protected]> wrote:
> Some more information would apt.
> random.gif is not a static image. It is being generated dynamically. The
> parameters provided in query string will decide the image generation which
> will vary.
>
> This makes it necessary that I serve this image using a symfony action.
>
> -Strike
>
>
> On Thu, Oct 22, 2009 at 4:18 PM, Sameer I <[email protected]> wrote:
>
>> Hi,
>>
>> How can I serve an image for request something like
>>
>> http://mysite.com/random.gif?a=87&b=87
>>
>> using symfony.
>>
>> Is there a way to configure route for such a request?
>>
>> -Strike
>>
>>
>>
>
> >
>
--
Noël GUILBERT
http://www.noelguilbert.com/
http://www.sensiolabs.com
http://www.symfony-project.com
Sensio Labs
Tél: +33 1 40 99 80 80
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---