Wednesday, 11 July 2012

How to get Relative Path and Absolute path from url_for in symfony?

Hi All,

Suppose you have following url:
http://localhost/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

Now

<?php  echo url_for('supportTool/wireTransferDetails'); ?>
The above code will provide following output:
/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

<?php  echo url_for('supportTool/wireTransferDetails', true); ?>
The above code will provide following output:
http://localhost/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

Cheers!

1 comment:

  1. I was hunting for symfony developer and landed onto your post and i must say thank you for sharing such useful information.

    ReplyDelete