In your template: <?php echo image_tag($sf_config->get('sf_upload_dir').'/myImages/'.$image_name) ?>
The $sf_config variable is a copy of the sfConfig object used in the actions. On Fri, Mar 12, 2010 at 12:10 AM, Luis Zarrabeitia <zarrabei...@gmail.com> wrote: > > Hello. I'm new to Symfony and I decided to learn by developing a small > web app. > > Right now, I have a form that uploads an image: > > 'image' => new sfValidatorFile(array( > 'required' > => false, > > 'path' => sfConfig::get('sf_upload_dir').'/myImages', > > 'mime_types' => 'web_images', > )), > > > The images are getting uploaded to the right place (http://localhost/ > myapp/uploads/myImages). Now, when I try to include them from a > template, how do I access the web path? I don't want to hardcode / > myapp/uploads, because at least the /myapp part could change (for > instance, on deployment). Is there any configuration setting or > variable that I could access from the template? > > Also, it seems that the sfValidatorFile stores/returns only the > filename, which means that I will have to hardcode /myImages. Am I > missing something? Is there a better way to retrieve the path relative > to the upload dir? > > Luis. > > -- > 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 > -- 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 For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en