Ask your Symfony questions! Pay money and get answers fast! (more info)

How to create links between different apps Symfony

  • SOLVED

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

[[LINK href="http://www.symfony-project.org/cookbook/1_2/en/cross-application-links"]]http://www.symfony-project.org/cookbook/1_2/en/cross-application-links[[/LINK]]

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

[[LINK href="http://stereointeractive.com/blog/2007/06/18/linking-between-apps-within-symfony/"]]http://stereointeractive.com/blog/2007/06/18/linking-between-apps-within-symfony/[[/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)

2010-05-28

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:


#routing.yml

logout:
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

2010-05-29

Jakub Zalas answers:

There's a symfony 1.0 plugin for cross application links: [[LINK href="http://www.symfony-project.org/plugins/pmCrossAppUrlPlugin"]]pmCrossAppUrlPlugin[[/LINK]]

In sfDoctrineSimpleCMSPlugin they have cross_app_link_to helper: [[LINK href="http://trac.symfony-project.org/browser/plugins/sfDoctrineSimpleCMSPlugin/branches/symfony-1.0/lib/helper/CrossApplicationHelper.php?rev=9530#L1"]]CrossApplicationHelper.php[[/LINK]]

And here's another variation of that function: [[LINK href="http://symfonier.blogspot.com/2009/03/cross-app-link.html"]]cross-app-link[[/LINK]]

2010-05-28

burgua answers:

Maybe it will help

http://rabaix.net/en/articles/2009/05/30/cross-link-application-with-symfony


Lawrence Krubner comments:

But that is not Symfony 1.0?


burgua comments:

> But that is not Symfony 1.0?

According to blog and plugin ( http://www.symfony-project.org/plugins/swCrossLinkApplicationPlugin ) of blog's author it's 1.2.

This plugin is for Symfony 1.1
http://www.symfony-project.org/plugins/sfLinkCrossAppPlugin

2010-05-28

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).

2010-05-28

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.