Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:34:30+00:00 2026-05-24T12:34:30+00:00

I am working on one small project – web site. There are gallery, user

  • 0

I am working on one small project – web site. There are gallery, user login, shop and many small text sections – with images and without.
I want to make pretty urls for example:

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)

and all other (text) pages goes to “PagesController”, but without /pages/view prefix

Contacts -> /eng/contacts
About us -> /eng/about_us

I thought that I can make something like this:

// 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'));

What is the best way to make it in routes.php? Maybe you can give some generic example?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:34:31+00:00Added an answer on May 24, 2026 at 12:34 pm

    For Gallery -> /eng/gallery (GalleryController::index) :

    Router::connect('/eng/gallery', 
        array('controller' => 'gallery', 'action' => 'index'));
    

    For Gallery album /eng/gallery/album_name_slug (GalleryController::view) :

    Router::connect('/eng/gallery/:album', 
        array('controller' => 'gallery', 'action' => 'view'), 
        array('pass' => array('album'),'album' => '[0-9a-zA-Z]+') 
    ); 
    

    repeat for Products controller

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a relatively small, but fast-changing project (a web application) with a
I'm currently working on a small project: there's a protocol for sending some strings
I am working on a small text editor project and want to add basic
I'm working on a small project, it is a web harvester created in python
I am working on a small project,where one of the step is to write
I'm working on a small project with one other developer. We are using libraries
I am working on a small project where I use multiple classes. One of
I'm considering using Mustache.js for a small project I'm working on.... The one thing
I'm working on a small project. There will be a Main Abstract class for
so ive been working on a small nodejs project and some of my user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.