Code snippets for symfony 1.x

Navigation

Refine Tags

Snippets tagged "base"

baseurl_for with an external application

Here is a usefull helper to calculate url for another application :

function baseurl_for($application, $absolute = false)
{
    $url = $absolute ? 'http://' . $_SERVER["HTTP_HOST"] : '';
    $url .= '/' . $application . (SF_ENVIRONMENT != 'prod' ? '_' . SF_ENVIRONMENT : '') . '.php/';
    return $url;
}

in the action :

<?php echo link_to('Whatever', baseurl_for('application', true) . 'module/action') ?>

I really feel like this feature is missing, hope this could added soon ;) ... example corrected (but sadly not so usefull) according to francois's comment.

by brikou on 2006-11-24, tagged application  base  helper  url 
(4 comments)