私は1つの小さなプロジェクトに取り組んでいます。ギャラリー、ユーザーログイン、ショップ、多くの小さなテキストセクションがあります。 私は例のためにかなりのURLを作りたい:CakePHP:経路と静的ページ
Gallery -> /eng/gallery (GalleryController::index)
Gallery album /eng/gallery/album_name_slug (GalleryController::view)
Shop -> /eng/products (ProductsController::index)
Shop one product -> /eng/products/product_name_slug (ProductsController::view)
と他のすべての(テキスト)のページは、「をPagesController」になりますが、なし/ページ/ビュープレフィックス
Contacts -> /eng/contacts
About us -> /eng/about_us
私は私が作ることができると考えました
// Homepage
Router::connect('/', array('controller' => 'homepage', 'action' => 'display'));
/* There delegate routes for each controller/method (gallery, shop, etc) */
// All what is not in thease controllers/methods goes to pagescontroller
Router::connect('/*', array('controller' => 'pages', 'action' => 'view'));
routes.phpで作成するにはどうすればよいですか?多分あなたはいくつかの一般的な例を挙げることができますか?
ありがとうございます!ギャラリーのために
私はドンあなたのルートに何か間違いがないか見てください。何がうまくいかないの? –
私は、すべての機能(製品/ギャラリー)のルートを委任しないで、この作業を得るために、posibilityがあることを知りたいだけです。 – Orbitum
「すべての機能ルートを委任する」とはどういう意味ですか? –