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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:20:09+00:00 2026-05-21T11:20:09+00:00

I am writing this web project in which one of the views will be

  • 0

I am writing this web project in which one of the views will be having two types of boxes. There is an array and based on type of the values of each item in the array i have to display one or the other box.

Qn is: Should i write the html code for boxes in the controller as two methods or should i write it as two functions and call on it from inside the view itself? Both methods sounds not so good. Your thoughts,suggestions or any ideas for a method outside of two i mentioned above?

Here is a link i saw which closely resembles my thought on writing html code in controller. PHP coding standards

  • 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-21T11:20:09+00:00Added an answer on May 21, 2026 at 11:20 am

    MVC is a guideline. It’s there to help you, if it’s hindering you getting the job done then something is wrong.

    I’m not sure I understand your question properly, but if you mean that you have to display different HTML depending on the data passed to you during run time, then I’d suggest you package that code in a helper function and call it from your view.

    On the other hand, if you mean that you’re views are well defined and unchanging, I’d just do the checking in the controller and display the appropriate view.

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

Sidebar

Related Questions

I am interested in writing a web based terminal which can execute and autocomplete
I'm having a class library which is getting referenced in a web application. This
I'm writing a web server based on Python which should be able to execute
I am writing a web page widget for my company. This widget must inject
Ok, this might be a really odd problem. I am writing a web application,
(I'm writing this in the context of JavaScript, but will accept an algorithmically correct
I'm planning on writing a spine/backbone.js style web application which basically just transfers a
I'm writing a web app similar to wtfimages.com in that one visitor should never
I'm currently in the preparatory phase for a project which will involve (amongst other
I'm writing a MVC web app in ASP.NET MVC, which is supposed to be

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.