Difference between revisions of "Model-View-Controller/es"

From Joomla! Documentation

(Updating to match new version of source page)
Line 1: Line 1:
 
<noinclude><languages/></noinclude>
 
<noinclude><languages/></noinclude>
{{Chunk:Model-View-Controller/es}}
+
{{Chunk:Model-View-Controller/en}}
 
+
==See Also==
==Véase También==
+
* [[S:MyLanguage/Understanding Output Overrides|Understanding Output Overrides]]
* [[S:MyLanguage/Understanding Output Overrides|Entendiendo los overrides de salida]]
+
* [[S:MyLanguage/Developers|Developers]]
* [[S:MyLanguage/Developers|Desarrolladores]]
 
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JModel.html JModel]
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JModel.html JModel]
 +
* [https://api.joomla.org/cms-3/classes/JModelLegacy.html JModelLegacy {{JVer|2.5}} and newer]
 +
* [https://api.joomla.org/cms-3/classes/JModelAdmin.html JModelAdmin {{JVer|2.5}} and newer]
 +
* [https://api.joomla.org/cms-3/classes/JModelBase.html JModelBase {{JVer|3.x}}]
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JView.html JView]
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JView.html JView]
 +
* [https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy {{JVer|2.5}} and newer]
 +
* [https://api.joomla.org/cms-3/classes/JViewBase.html JViewBase {{JVer|3.x}}]
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JController.html JController]
 
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JController.html JController]
 +
* [https://api.joomla.org/cms-3/classes/JControllerForm.html JControllerForm {{JVer|2.5}} and newer]
 +
* [https://api.joomla.org/cms-3/classes/JControllerAdmin.html JControllerAdmin {{JVer|2.5}} and newer]
 +
* [https://api.joomla.org/cms-3/classes/JControllerBase.html JControllerBase {{JVer|3.x}}]
  
===Serie sobre desarrollo de Componentes===
+
===Component development series===
 
<div class="large-6 column">
 
<div class="large-6 column">
====Desarrollando un Componente MVC para J3.x ====
+
====Developing a MVC Component for J3.x ====
[[S:MyLanguage/J3.2:Developing a MVC Component/Introduction|Introducción al desarrollo de un componente MVC en J3.x]]
+
[[S:MyLanguage/J3.2:Developing a MVC Component/Introduction|Introduction to Developing a 3.x MVC]]
 
</div>
 
</div>
 
<div class="large-6 column">
 
<div class="large-6 column">
====Desarrollando un componente MVC para J2.5 ====
+
====Developing a MVC Component for J2.5 ====
[[S:MyLanguage/J2.5:Developing a MVC Component/Introduction|Introducción al desarrollo de un componente MVC para J2.5]]
+
[[S:MyLanguage/J2.5:Developing a MVC Component/Introduction|Introduction to Developing a 2.5 MVC]]
 
</div>
 
</div>
[[Category:Landing Pages/es]][[Category:Glossary/es]]__NOTOC__
+
 
 +
<noinclude>
 +
[[Category:Landing Pages]]
 +
[[Category:Glossary]]
 +
[[Category:Development]]
 +
[[Category:Beginner Development]]
 +
</noinclude>
 +
__NOTOC__

Revision as of 13:05, 24 June 2015

Other languages:
Bahasa Indonesia • ‎English • ‎Kiswahili • ‎Nederlands • ‎català • ‎español • ‎français • ‎italiano • ‎日本語

Joomla makes extensive use of the Model-View-Controller design pattern.

When Joomla is started to process a request from a user, such as a GET for a particular page, or a POST containing form data, one of the first things that Joomla does is to analyse the URL to determine which component will be responsible for processing the request, and hand control over to that component.

If the component has been designed according to the MVC pattern, it will pass control to the controller. The controller is responsible for analysing the request and determining which model(s) will be needed to satisfy the request, and which view should be used to return the results back to the user.

The model encapsulates the data used by the component. In most cases this data will come from a database, either the Joomla database, or some external database, but it is also possible for the model to obtain data from other sources, such as via a web services API running on another server. The model is also responsible for updating the database where appropriate. The purpose of the model is to isolate the controller and view from the details of how data is obtained or amended.

The view is responsible for generating the output that gets sent to the browser by the component. It calls on the model for any information it needs and formats it appropriately. For example, a list of data items pulled from the model could be wrapped into an HTML table by the view.

Since Joomla is designed to be highly modular, the output from the component is generally only part of the complete web page that the user will ultimately see. Once the view has generated the output, the component hands control back to the Joomla framework which then loads and executes the template. The template combines the output from the component, and any modules that are active on the current page, so that it can be delivered to the browser as a single page.

To provide additional power and flexibility to web designers, who may only be concerned with creating new designs rather than manipulating the underlying code, Joomla splits the traditional view into a separate view and layout. The view pulls data from the model, as in a traditional MVC pattern, but then simply makes that data available to the layout, which is responsible for formatting the data for presentation to the user. The advantage of having this split is that the Joomla template system provides a simple mechanism for layouts to be overridden in the template. These layout overrides (often called "template overrides" because they form part of the template, although actually it is the layout that is being overridden) are bundled with the template and give the template designer complete control over all the output from the Joomla core and any installed third-party extensions that comply with the MVC design pattern.


See Also

Component development series

Developing a MVC Component for J3.x

Introduction to Developing a 3.x MVC

Developing a MVC Component for J2.5

Introduction to Developing a 2.5 MVC