0
末尾には見られない私は、次のルートがありますsymfonyの2/3ルートスラッシュ
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
options:
を私はルートのこの種のためにSEOの推奨の、最後のスラッシュで終わって欲しいです。 しかし、私はそれを動作させることはできません。私はでstr_replaceを呼び出すために作るもの、
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}/
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
requirements:
childSlug: .+
fatherSlug: .+
grandFatherSlug: .+
が、私は追加の末尾のスラッシュとの最後のパラメータを取得する:私は試してみました:
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}/
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
options:
しかし、私はルートが見つからない例外を取得し、とコントローラーを取り外してください。
この動作を達成するための簡単な解決法はありますか?
おかげ
http://symfony.com/doc/current/routing/redirect_trailing_slash.html –