Absolute path in Symfony1.4

746 views Asked by At

I am looking for how to get absolute path using symfony1.4. If any one help me with this issue. for example,

 <img src="'.public_path('logo.jpg').'" alt="html logo" style="width:70px;height:70px;">

The path which i get is like,

/erp/symfony/web/logo.jpg

but what i want is like,

 C:/wamp/www/erp/symfony/web/logo.jpg

I need this path to export my image using DOMPDF.

I would really appreciate them.

Thanks in advance!

1

There are 1 answers

0
Pabloks On

You should use

sfConfig::get("sf_web_dir")

which brings you the absolute dir of your web path.

In your case it will be :

<img src="<?php echo sfConfig::get("sf_web_dir")?>/logo.jpg" alt="html logo" style="width:70px;height:70px;">