スキップしてメイン コンテンツに移動

投稿

ラベル(routing)が付いた投稿を表示しています

Symfonyフレームワークで設定されているroutingの一覧を取得する方法

Symfonyフレームワークで設定されているroutingの一覧を取得するには、下記のコマンドを実行すればOKです。 php bin/console debug:router 下記の情報が取得できます。 Name: routing名。 Method: 受け入れ可能なHTTPのメソッド。GET/POSTやANYなどが表示される。 Scheme: https、http、ANY。 Host: 普通はANY Path: URLパス。

Symfony2: Switching URL for Different Environment

Issue For Symfony2, if you would like to setup different url based on environment but using same action in controller, what should we do? In my case, I would have liked to setup different url based on different country enviroment but would have liked to use same action becaseu the functionality itself is completely same. Solution Setup routing.yml for each environment. Symfony2 porvides mailnly 2 ways to setup routing configuration - routing.yml and annotation on controller. I think using annotation is better way because you can easily check functionality and routing relation in controller class. However if you would like to setup different url based on different environment, using routing.yml is better way. Ok now I will show you my approach.... 1) You should prepare routing_shared.yml for common shared routing between environment. 2) You should preare routing.yml for rach enviroment which is depends on the environment, like routing_env_1.yml, routing_env_2.yml, etc. And