elxisPlugin

Last update by Elxis Team

Elxis library for handling content plugins.

Elxis triggers elxisPlugin internally inside component content. So a developer doesn't have to work with the elxisPlugin library directly except for special cases. Such a case is to execute plugins in your own extension or remove existing plugins from an article in order to display a plugins-free version of it. Also the parseAttributes method is an easy way to parse plugin code attributes, so if you don't want to create your own paser, you can use this one.

Public methods

process

Executes all available plugins against an article (or other item). The process method calls internally the process method of the each plugin extension. The final output is the result of all replacements made by the plugins.

public function process(&$row)

removePlugins

Removes all plugin code {xxx}{/xxx} from the given $text.

public function removePlugins($text)

usedPlugins

Returns an array of all plugins used in the given $text

public function usedPlugins($text)

parseAttributes

Parses an attributes string and returns an array of the attributes used as key - value pairs.

public function parseAttributes($string)

In the example below we will use the parseAttributes method to parse the attributes string width="200" height="100"

{test width="200" height="100"}something{/test}
$ePlugin = eFactory::getPlugin();
$attributes = $ePlugin->parseAttributes('width="200" height="100"')

The result will be:

$attributes = array('width' => 200, 'height' => 100);

runData

Returns informational data for the elxisPlugin library usage. The returned data is an array informing as about all the available plugin, the number of items (usually articles) the plugins were executed against and the total number of plugin executions.

public function runData()

Create a plugin

Read our developing plugins for Elxis tutorial.



 

It has been read 6497 times
elxisUri
Previous article
elxisUri
elxisGrid
Next article
elxisGrid

You are free to copy, distribute and transmit the articles in this site for non-commercial purposes.
Creative Commons 3.0