Plugin/Events/Module: Difference between revisions

From Joomla! Documentation

< Plugin‎ | Events
Wilsonge (talk | contribs)
m Fix indent
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{incomplete}}
<noinclude><languages /></noinclude>
 
<translate><!--T:1-->
In a standard installation of Joomla! we have several predefined Module events which, when triggered, call functions in the associated plugins.
In a standard installation of Joomla! we have several predefined Module events which, when triggered, call functions in the associated plugins.</translate>


==onRenderModule==
==onRenderModule==
===Description===
<translate>
This is an event that is called when a module on the front- or back-end is renderd.
===Description=== <!--T:2-->
===Parameters===
</translate>
*<code>&module</code> A reference to a Module object that holds all the data of the module
<translate><!--T:3-->
*<code>&attribs</code>  An array of attributes for the module
This is an event that is called when a module on the front- or back-end is rendered.</translate>
===Return Value===
<translate>
None. Result will be omitted.
===Parameters=== <!--T:4-->
</translate>
*<code>&module</code> <translate><!--T:5-->
A reference to a Module object that holds all the data of the module</translate>
*<code>&attribs</code>  <translate><!--T:6-->
An array of attributes for the module</translate>
<translate>
===Return Value=== <!--T:7-->
</translate>
<translate><!--T:8-->
None. Result will be omitted.</translate>


==onRenderModule==
==onAfterRenderModule==
===Description===
<translate>
This is an event that is called when after a module is renderd on the back- or front-end
===Description=== <!--T:9-->
===Parameters===
</translate>
*<code>&module</code> A reference to a Module object that holds all the data of the module
<translate><!--T:10-->
*<code>&attribs</code> An array of attributes for the module
This is an event that is called when after a module is rendered on the back- or front-end</translate>
===Return Value===
<translate>
None. Result will be omitted.
===Parameters=== <!--T:11-->
</translate>
*<code>&module</code> <translate><!--T:12-->
A reference to a Module object that holds all the data of the module</translate>
*<code>&attribs</code> <translate><!--T:13-->
An array of attributes for the module</translate>
<translate>
===Return Value=== <!--T:14-->
</translate>
<translate><!--T:15-->
None. Result will be omitted.</translate>


==onPrepareModuleList==
== onAfterRenderModules ==
===Description===
=== Description ===
This is an event that is called when after all modules are rendered on the back- or front-end for a given module position. Introduced in {{JVer | 3.7}}


===Parameters===
=== Parameters ===
*<code>&buffer</code>
A reference to the output html of the modules being rendered
*<code>&params</code>
An array of parameters for the module renderer


===Return Value===
=== Return Value ===
None. Result will be omitted.


===Used in files===
==onPrepareModuleList==
<translate>
===Description=== <!--T:16-->
</translate>
<translate><!--T:17-->
This is an event that is called before the list of modules that must be rendered is created. If the <code>&modules</code> parameter is an array of module objects, the default module list generated by Joomla! is ignored.</translate>


===Example===
<translate>
===Parameters=== <!--T:18-->
</translate>
<translate><!--T:19-->
*<code>&modules</code> Reference to a empty variable for the list of modules</translate>
<translate>
===Return Value=== <!--T:20-->
</translate>
<translate><!--T:21-->
None. Result will be omitted.</translate>


==onAfterModuleList==
==onAfterModuleList==
===Description===
<translate>
 
===Description=== <!--T:22-->
===Parameters===
</translate>
 
<translate><!--T:23-->
===Return Value===
This is an event that is called after the list of modules that must be rendered is created.</translate>
 
<translate>
===Used in files===
===Parameters=== <!--T:24-->
 
</translate>
===Example===
*<code>&modules</code> <translate><!--T:25-->
Reference to an array of module objects</translate>
<translate>
===Return Value=== <!--T:26-->
</translate>
<translate><!--T:27-->
None. Result will be omitted.</translate>


==onAfterCleanModuleList==
==onAfterCleanModuleList==
===Description===
<translate>
 
===Description=== <!--T:28-->
===Parameters===
</translate>
 
<translate><!--T:29-->
===Return Value===
This is an event that is called after the module list is cleaned.</translate>
 
<translate>
===Used in files===
===Parameters=== <!--T:30-->
</translate>
*<code>&modules</code> <translate><!--T:31-->
A reference to an array of rendered module objects</translate>
<translate>
===Return Value=== <!--T:32-->
</translate>
<translate><!--T:33-->
None. Result will be omitted.</translate>


===Example===
<noinclude>
<translate>
<!--T:34-->
[[Category:Plugin Development|Events]]
[[Category:Plugins|PluginsEvents]]
</translate>
</noinclude>

Latest revision as of 22:50, 27 May 2019

In a standard installation of Joomla! we have several predefined Module events which, when triggered, call functions in the associated plugins.

onRenderModule

Description

This is an event that is called when a module on the front- or back-end is rendered.

Parameters

  • &module A reference to a Module object that holds all the data of the module
  • &attribs An array of attributes for the module

Return Value

None. Result will be omitted.

onAfterRenderModule

Description

This is an event that is called when after a module is rendered on the back- or front-end

Parameters

  • &module A reference to a Module object that holds all the data of the module
  • &attribs An array of attributes for the module

Return Value

None. Result will be omitted.

onAfterRenderModules

Description

This is an event that is called when after all modules are rendered on the back- or front-end for a given module position. Introduced in Joomla 3.7

Parameters

  • &buffer

A reference to the output html of the modules being rendered

  • &params

An array of parameters for the module renderer

Return Value

None. Result will be omitted.

onPrepareModuleList

Description

This is an event that is called before the list of modules that must be rendered is created. If the &modules parameter is an array of module objects, the default module list generated by Joomla! is ignored.

Parameters

  • &modules Reference to a empty variable for the list of modules

Return Value

None. Result will be omitted.

onAfterModuleList

Description

This is an event that is called after the list of modules that must be rendered is created.

Parameters

  • &modules Reference to an array of module objects

Return Value

None. Result will be omitted.

onAfterCleanModuleList

Description

This is an event that is called after the module list is cleaned.

Parameters

  • &modules A reference to an array of rendered module objects

Return Value

None. Result will be omitted.