Ask your Symfony questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to create links between different apps Symfony


A friend asked me how to create links between different apps. I suggested this cookbook link:

[[LINK href=""]][[/LINK]]

However, his site is running Symfony 1.0. So I pointed him to this post by the always insightful Scott Meves:

[[LINK href=""]][[/LINK]]

But he doesn't want to record absolute links anywhere.

Are there any other ways to create links between apps on a Symfony 1.0 site?

Answers (5)


Juan Guillermo GarcĂ­a answers:

Try adding a new route in your routing.yml file from the application you want to make a link.

For example you are adding a link to an action called "logout" which is managed under "usersession" module in an application called "login".

So you need to add:


url: ../login.php/usersession/logout

Now in your template file you add:

<a href="<?php echo url_for('@logout') ?>">Log Out</a>

Hope this example is clear to help you creating cross apps links


Jakub Zalas answers:

There's a symfony 1.0 plugin for cross application links: [[LINK href=""]]pmCrossAppUrlPlugin[[/LINK]]

In sfDoctrineSimpleCMSPlugin they have cross_app_link_to helper: [[LINK href=""]]CrossApplicationHelper.php[[/LINK]]

And here's another variation of that function: [[LINK href=""]]cross-app-link[[/LINK]]


burgua answers:

Maybe it will help

Lawrence Krubner comments:

But that is not Symfony 1.0?

burgua comments:

> But that is not Symfony 1.0?

According to blog and plugin ( ) of blog's author it's 1.2.

This plugin is for Symfony 1.1


Arturo Linares answers:

I think the best way to do it is the Scott Meves method.

Sf is not aware of other applications when the front controller is loaded and the method you're using to access them (subdomains, subdirectories in the web directory or renamed front controller php files).


Martin Palacio answers:

If you are using Apache, maybe you can define some rewrite rules (look for the sample .htaccess file in your sf project) for example, using the "convention over configuration" principle.