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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:46:02+00:00 2026-06-13T22:46:02+00:00

I have been using joomla more than for a year now and familiar with

  • 0

I have been using joomla more than for a year now and familiar with the MVC pattern as well. But I’m unclear how Joomla uses MVC when showing a view. In the components deveopers use below two method.

1st method

class myView extends JView
{
     function display($tpl = null)
     {                  
       //HTML & PHP goes here
     }  

}

2nd method

class myView extends JView
{
        function display($tpl = null)
            {                   
            parent::display($tpl);
            }   

}

In the 2nd method they create a tmpl folder and place a default.php inside of it. All the HTML and PHP code then goes inside that file.

Now problem is why they use 2nd method when we can right away use 1st method? What’s the industry standard? What are the pros and cons of above methods? What should be used and why and depending on what? 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-06-13T22:46:03+00:00Added an answer on June 13, 2026 at 10:46 pm

    There is no “industry standard”. But MVC has such concept as “separation of concerns”.

    The second approach is much closer to the spirit of MVC-inspired patterns. Views are supposed to be responsible for UI logic. And, if this logic require to generate response, views multiple templates to create it. Or it might choose just to sent an HTTP header.

    The first approach is “quick’n’dirt” version. It often means, that UI logic has leaked in controller. Or, that developer does not understand why spaghetti code is a bad thing.

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

Sidebar

Related Questions

I have been using joomla for a while now. I come across JRequest::setVar('hidemainmenu', 1)
I have been using echo $.sprintf(%01\$.2f,$numvar); for my USD formatting, but I only copied
have been using no DOCTYPE but rather simply starting with <html> as per HTML5
Hi I have been using Rokstories, a mootools javascript slideshow in Joomla, I am
I have been using Castle MonoRail for the last two years, but in a
So I have been experimenting with RootsTheme (which uses Bootstrap), Wordpress (from Joomla! background)
I have been using TortoiseSVN for some time and I really like it. I
I have been using Stanford POS Tagger to tag parts of speech in a
I have been using play 1.2.5rc4 for development of one app and I have
I have been using an API to do some work. This is how 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.