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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:11:28+00:00 2026-06-10T19:11:28+00:00

A have a CI 2 project, and in a view I have 3 box,

  • 0

A have a CI 2 project, and in a view I have 3 box, and I have to show them on different page, different routes. Approximately on 8 different route, so where suppose I declare them?

In the view in every function( 8 of them) or in the one view file and check for the current route if it’s match the criteria. The problem, that not all of them should be shown, A box only in 5 view, B box in 4 and C box in 2 example.

  • 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-06-10T19:11:28+00:00Added an answer on June 10, 2026 at 7:11 pm

    I would declare it where it is most centralized. Checking to load the view in every function would mean that if you were to change your condition you’d have to update it in 8 different places!! That is not fun to maintain.

    By checking in one view file everythin is more centralized. This might seem silly because your conditional can get big,

    if ($is_route_1 || $is_route_2 || $is_route_4 || $is_route_5) { 
     // display the box
    }
    

    So if you wanted to display it on another page you can add it right here in the one view.

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

Sidebar

Related Questions

I have BaseView which implement UIViewController. Every view in project must implement this BaseView.
In a VS2008 web site project, I have a page open in split view.
I have a drupal view which pulls out project screen shots and puts them
I have gwt-project that is comunication to database. Application design mvp pattern and view
In my project I have a grid view which contains images. Based on my
I have developed a view based project in Xcode. It is successfully running in
I have a Java project that I'm trying to implement with a model-view-controller design.
In my MVC project I have a chart being generated on my view as
In my rails project I have a presenter method that has a helper view
In my simple project I have 2 views - a line item view (Brand)

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.