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

  • Home
  • SEARCH
  • 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 732643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:09:57+00:00 2026-05-14T07:09:57+00:00

Here is a quick overview of the controllers functionality in most of the application:

  • 0

Here is a quick overview of the controllers functionality in most of the application:

  • controller loads a specific model, gets data from it, formats the data and passes the formatted data to the view.

Now there is a search page, which needs to do a search query over entire database (all models). It needs to show each type of data in its particular formatted output on a single page as a list.

The problem:

The search controller can do the search, dynamically load model for each record type, and get the data from model. Problem comes when the data needs to be formatted. I am trying to load the specific controller from the search controller, which is causing problems.

What to do?

PS: I tried using the ‘Wick’ library, but it fails when the controller’s format function tries to use its own model and session object, giving errors about call to a member on a non-object.

  • 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-14T07:09:57+00:00Added an answer on May 14, 2026 at 7:09 am

    After much refactoring and trial/error, It appears that the best way to achieve the above is this way:

    1. Keep the format function in the base controller from which all other controllers are derived. The format options are passed to the function along with the data object as arguments.

    2. Make a static function in each derived controller, which returns the formatting options of the data.

    3. Inside the search controller (which is itself derived from the base controller), for each data object, call the static function of its particular controller which returns the data formatting options, then use that to format the object for the view.

    I guess I can say I will stick to using the model only for interaction with the database, and let everything else be done by controller. If anyone has a better solution still, I am all ears.

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

Sidebar

Related Questions

Please read here and here to get a quick overview of my problem and
I'm having trouble swapping Short Description (Quick Overview) with Additional Information (Attributes) Here's an
The quick overview is this: for my web app I can write most of
Here's a quick question I've been banging my head against today. I'm trying to
Here is a quick test program: public static void main( String[] args ) {
Here's the quick and skinny of my issue: $(a).toggle(function() { /*function A*/ }, function()
Here's a quicky question. Which method name makes the most sense for an Objective-C
Today I needed to parse some data out from an xlsx file (Office open
Quick overview Trying to insert a Business Object using ObjectDataSource (on a GridView) Get
I'm trying to build a quick overview that shows the upcoming calendar week. I

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.