API Guides: Difference between revisions

From Joomla! Documentation

Robbiej (talk | contribs)
m added tags and registry
No edit summary
 
(9 intermediate revisions by 4 users not shown)
Line 2: Line 2:


Each API guide includes sample code which you can copy and install in your own development environment. Generally these code samples are written to be included and installed as Joomla module, so if you're not familiar with Joomla module development you may find going through the short series [[Creating a simple module|Creating a Simple Module]] useful.
Each API guide includes sample code which you can copy and install in your own development environment. Generally these code samples are written to be included and installed as Joomla module, so if you're not familiar with Joomla module development you may find going through the short series [[Creating a simple module|Creating a Simple Module]] useful.
Note that this is work in progress!


Around Joomla 3.8 the Joomla development team began changing the naming convention of Joomla classes to use namespaces, so that for example JFactory changed to Factory in the Joomla\CMS namespace. As you read existing Joomla code and documentation you may find the classes following either the new or the old naming standard. You can find the mapping between the two naming conventions in the <tt>libraries/classmap.php</tt> file in your Joomla instance.
Around Joomla 3.8 the Joomla development team began changing the naming convention of Joomla classes to use namespaces, so that for example JFactory changed to Factory in the Joomla\CMS namespace. As you read existing Joomla code and documentation you may find the classes following either the new or the old naming standard. You can find the mapping between the two naming conventions in the <tt>libraries/classmap.php</tt> file in your Joomla instance.


* The base Application classes and their hierarchy and purposes is described in [[J3.x:Understanding_the_Application_classes|Understanding the Application classes]]
* Ajax handling within Joomla Components is described in [[JSON Responses with JResponseJson]]. Ajax can also be used within Joomla Modules and Plugins as described in [[Using Joomla Ajax Interface]].
* Ajax handling within Joomla Components is described in [[JSON Responses with JResponseJson]]. Ajax can also be used within Joomla Modules and Plugins as described in [[Using Joomla Ajax Interface]].
* [[Cache Basic API Guide|Cache]] - how to use callback cache within your code.
* [[Categories and CategoryNodes API Guide|Categories]] Using the <tt>Categories</tt> and <tt>CategoryNode</tt> classes to access data relating to Joomla categories
* [[Categories and CategoryNodes API Guide|Categories]] Using the <tt>Categories</tt> and <tt>CategoryNode</tt> classes to access data relating to Joomla categories
* CSS can be added as described in [[Adding JavaScript and CSS to the page]]
* Database / JDatabase. There are two API guides, covering [[Selecting data using JDatabase]] and [[Inserting, Updating and Removing data using JDatabase]]
* Database / JDatabase. There are two API guides, covering [[Selecting data using JDatabase]] and [[Inserting, Updating and Removing data using JDatabase]]
* [[How to use JDate|Date/JDate]] is Joomla's Date class.
* Files and Folders. See [[How_to_use_the_filesystem_package|How to use the filesystem package]].
* Files and Folders. See [[How_to_use_the_filesystem_package|How to use the filesystem package]].
* Form / JForm. There is a [[Basic form guide|Basic guide]] to using the Joomla Form API and incorporating forms within a Joomla component, and also a more [[Advanced form guide]] covering more advanced aspects of the APIs.  
* Form / JForm. There is a [[Basic form guide|Basic guide]] to using the Joomla Form API and incorporating forms within a Joomla component, and also a more [[Advanced form guide]] covering more advanced aspects of the APIs.  
* FormField / JFormField. This class and related classes such as JFormFieldList which inherit from it are primarily useful for defining custom form fields, as described in [[Creating a custom form field type]].
* FormField / JFormField. This class and related classes such as JFormFieldList which inherit from it are primarily useful for defining custom form fields, as described in [[Creating a custom form field type]].
* [[Retrieving request data using JInput|Input / JInput]] Using the <tt>Input</tt> class to obtain the values of parameters in HTTP GET and POST requests
* [[Retrieving request data using JInput|Input / JInput]] Using the <tt>Input</tt> class to obtain the values of parameters in HTTP GET and POST requests
* JavaScript can be added as described in [[Adding JavaScript and CSS to the page]]
* Using Joomla Layouts is described in [[J3.x:Sharing layouts across views or extensions with JLayout|Sharing layouts across views or extensions with JLayout]]. The flexibility was increased in Joomla 3.2, as described in [[J3.x:JLayout Improvements for Joomla!|JLayout Improvements for Joomla!]].
* [[Using JLog|Log / JLog]] Log messages (eg error messages, debug messages) to a log file, and optionally to the debug console  
* [[Using JLog|Log / JLog]] Log messages (eg error messages, debug messages) to a log file, and optionally to the debug console  
* [[Menu and Menuitems API Guide|Menu and Menuitems]]
* [[Menu and Menuitems API Guide|Menu and Menuitems]]
* [[Using nested sets|Nested Sets]], which enable a tree hierarchy to be implemented in the database table, are used by Joomla menus, articles, categories, etc.
* [https://github.com/joomla-framework/registry Registry/JRegistry] is a utility class which is very useful for handling PHP arrays, converting to JSON, etc.  
* [https://github.com/joomla-framework/registry Registry/JRegistry] is a utility class which is very useful for handling PHP arrays, converting to JSON, etc.  
* [[JSON_Responses_with_JResponseJson|JResponseJson]] supports responding in JSON format to Ajax requests.  
* [[JSON_Responses_with_JResponseJson|JResponseJson]] supports responding in JSON format to Ajax requests.  
* Route / JRoute see [[URLs in Joomla]]
* Route / JRoute see [[URLs in Joomla]]
* Table / JTable provides functionality for performing CRUD operations (and more) on database tables. The guide is split into a [[Table Basic API Guide|Basic API Guide]] and an [[Table Advanced API Guide|Advanced API Guide]]
* Table / JTable provides functionality for performing CRUD operations (and more) on database tables. The guide is split into a [[Table Basic API Guide|Basic API Guide]] and an [[Table Advanced API Guide|Advanced API Guide]]
* The [[Controllers|Controllers]] (BaseController, AdminController, FormController, ApiController) are responsible for analysing the user's request, checking that the user is allowed to perform that action and determining how to satisfy the request.
* The [[Models|Models]] (BaseModel, BaseDatabaseModel, ItemModel, ListModel, FormModel, AdminModel) encapsulate the data used by the component. They are also responsible for updating the database where appropriate.
* The [[Views|Views]] (AbstractView, CategoriesView, CategoryFeedView, CategoryView, FormView, HtmlView, JsonApiView, JsonView, ListView) specify what should appear on the web page, and collates all the data necessary for outputting the HTTP response..
* [[Tags API Guide|Tags]].  
* [[Tags API Guide|Tags]].  
* Uri / JUri see [[URLs in Joomla]]
* Uri / JUri see [[URLs in Joomla]]
Line 29: Line 37:
[[Category:Beginner Development{{#translation:}}]]  
[[Category:Beginner Development{{#translation:}}]]  
[[Category:Development{{#translation:}}]]  
[[Category:Development{{#translation:}}]]  
[[Category:Component_Development{{#translation:}}]]
[[Category:Module_Development{{#translation:}}]]
[[Category:Plugin_Development{{#translation:}}]]
[[Category:Tutorials{{#translation:}}]]  
[[Category:Tutorials{{#translation:}}]]  
</noinclude>
</noinclude>

Latest revision as of 15:25, 5 January 2021

This page contains an index to the set of Joomla API Guides. These guides aim to help you understand how to use these Joomla functions in your own Joomla extensions.

Each API guide includes sample code which you can copy and install in your own development environment. Generally these code samples are written to be included and installed as Joomla module, so if you're not familiar with Joomla module development you may find going through the short series Creating a Simple Module useful.

Around Joomla 3.8 the Joomla development team began changing the naming convention of Joomla classes to use namespaces, so that for example JFactory changed to Factory in the Joomla\CMS namespace. As you read existing Joomla code and documentation you may find the classes following either the new or the old naming standard. You can find the mapping between the two naming conventions in the libraries/classmap.php file in your Joomla instance.