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 7085471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:25:42+00:00 2026-05-28T07:25:42+00:00

I am trying to build an application that can search the database for different

  • 0

I am trying to build an application that can search the database for different City information. (for example: if the user click New York, it will show lots of information about New York.) Do I have to create different controllers for different cities? like New York controller -> New York Model. Seattle controller -> Seattle Model. Chicago controller -> Chicago Model That sounds redundant. What is the best way to approach my problem. Thanks for the helps.

  • 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-28T07:25:43+00:00Added an answer on May 28, 2026 at 7:25 am

    You could have a City model with a lookup function that accepts a city name as a parameter and returns whatever relevant data. Then, you’ll have a controller that accepts a city as a parameter, too. So, for example, http://localhost/index.php/city/lookup/new_york where city is the controller, lookup is the function, and new_york is the parameter to the function.

    The lookup function in the controller would pass the parameter it received to the city model lookup function. Whatever the model returns, the controller would pass to the view to be rendered.

    You should probably not have a separate controller and model for each city.

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

Sidebar

Related Questions

I'm trying to build an application so that the user can see table entries
I'm trying to build a application that has different kinds of users, I'm using
I am trying to build an application that can detect if the Messaging application
I am trying to build a Google Maps-driven web application that can display a
we're trying to figure out a way to build a .NET application that can
I am trying to build a console application that takes user input. I was
We are trying to build a silverlight application that allows a user to stream
What I’m trying to do: Build a mobile web application where the user can
I'm trying to build an application that builds a resource file into a jar,
I'm currently trying to build an application that inherently needs good time synchronization across

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.