1

Legacy component MVC structure:

com_foo
|- controllers
|  |- foo.php
|- helpers
|  |- foo.php
|- models
|  |- forms
|  |  |- foo.xml
|  |- foo.php
|- views
|  |- foo
|  |  |- tmpl
|  |  |  |- default.php
|- foo.php

Joomla 4/5 MVC structure:

com_foo
|- forms
|  |- foo.xml
|- services
|  |- provider.php
|- src
|- |- Controller
|- |- |- DisplayController.php
|- |- |- FooController.php
|- |- Extension
|- |- |- FooComponent.php
|- |- Helper
|- |- |- FooHelper.php
|- |- Model
|- |- |- FooModel.php
|- |- Table
|- |- |- FooTable.php
|- |- View
|- |- |- Foo
|- |- |- |- HtmlView.php
|- tmpl
|- |- foo
|- |- |- default.php

The first structure is now called LegacyComponent. Does anyone know if this is announced as deprecated, or in which version will it stop working?

2 Answers 2

2

My understanding is I don't believe it will 'stop working'. The new structure is guideline or preferred structure that brings Joomla inline with other frameworks. You can have whatever structure you like, including the J3 style, but you may find that you have to put in more specific references to where you have located things as Joomla may start to remove the backward compatibility code that locates things automatically in a future version.

3
  • Thank you for your answer. Have you seen by any chance where this structure change was discussed? Perhaps they mention their future plans there. Commented Jan 23 at 11:21
  • I don't recall reading a specific item or article about the change. Like many things Joomla you pick up bits and pieces here and there to form an understanding of what is going on.
    – Irata
    Commented Jan 24 at 2:09
  • That is true... I have upvoted your answer, but I will wait until we find something official, before setting an answer as the accepted one. I hope that's ok. Commented Jan 24 at 9:32
1

According to information from volunteers over at the Joomla Mattermost community, the most up-to-date information is the one found in code comments. I received this link to Joomla's code that currently says that loading such Legacy structure will be removed in 6.0 without replacement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.