$ajaxFile
$ajaxFile : boolean
The ajaxFile property, it will replace any string starting with ajax.php to full url if true.
The Plugin class that represents a basic unit of CJAX's plugin system.
Since CJAX 6.0, Plugin class is lightweight and only contains information of one specific plugin object.
$controllersDir : \CJAX\Plugin\ExamplePlugin\unknown_type
For ajax request use the plugin name in place of the controller in the url, it will automatically point to your plugin.
eg. ajax.php?ExamplePlugin/docs
Cjax will add the plugin controller on top of the list, if a controller is not found it will continue its normal process and see for a controller in the default controller process.
would seek for: plugins/ExamplePlugin/cntrollers/ExamplePlugin.php:docs();
$xml : \CJAX\Core\XmlItem
The xml property, stores an instance of XmlItem object for this plugin.
$coreEvents : \CJAX\Core\CoreEvents
The coreEvents property, stores an instance of injected CoreEvents object.
__construct(\CJAX\Core\CoreEvents $coreEvents, array $array = array()) : \CJAX\Core\Plugin
The constructor for Plugin class, creates an instance of Plugin object.
\CJAX\Core\CoreEvents | $coreEvents | |
array | $array |
xmlObject() : \CJAX\Core\XmlItem
The xmlObject method, gets the XmlItem object associated with this plugin.
set(string $setting, mixed $value, integer $instanceId = null) : void
Update parameters You may use a,b,c,d,e,f etc.
. as $setting.
if the setting is called other than the alphabeth, you may still access these settings eg:
Instead of updating parameters you would be updating variables
Lets say you set variable testing:
$this->set('testing','Hello!');
in your plugin you can access it as: this.testing (if it is inside the scope) or ExamplePlugin.testing outside the scope of your plugin.
if you use __get() magic function, you should be able to intercept.
string | $setting | |
mixed | $value | |
integer | $instanceId |
___construct(\CJAX\Plugin\ExamplePlugin\unknown_type $arg, \CJAX\Plugin\ExamplePlugin\unknown_type $arg2)
Constructor
This function is ran when the plugin is initialized as $ajax->ExamplePlugin();
Paramaters: through the plugin contructor eg. $ajax->ExamplePlugin('test1','test2');
This function is ran on contruction - for both page load and ajax.
\CJAX\Plugin\ExamplePlugin\unknown_type | $arg | |
\CJAX\Plugin\ExamplePlugin\unknown_type | $arg2 |
waitfor(\CJAX\Plugin\ExamplePlugin\unknown_type $file)
$this->waitFor('Some-js-file-loaded-throgh-import.js');
Lets say that you loaded a javascritp file usin:
$ajax->import('some_file.js');
Javascript loads scripts acrimoniously so some times even if you load script #1 before #2, it is posibble that script #2 loads before script #1, so this would prevent some times the plugin to work. Here is where waitFor comes in.
$ajax->waitFor() - allows #1 to fully load before loading script #2.
Also there is another approach to this, see: $this->callback();
\CJAX\Plugin\ExamplePlugin\unknown_type | $file |
onLoad(\CJAX\Plugin\ExamplePlugin\unknown_type $arg = null, \CJAX\Plugin\ExamplePlugin\unknown_type $ar2 = array())
Semi-Constructor function
This function is automatically fired on page load when the loading is invoqued. Is similar to the constructor, except this one won't be fired on ajax requests, just on page load.
The parameters of the contructor will be passed.
\CJAX\Plugin\ExamplePlugin\unknown_type | $arg | |
\CJAX\Plugin\ExamplePlugin\unknown_type | $ar2 |
callbackHandler( $xmlObjFrom, $xmlObjTo, $setting)
Advanced Callback Handler
Pushes an API to be a part of another API or Plugin instead of running on its own, then you may access that other callback in plugins through this.callback
If your rightHandler is a callback, you may create a custom handler for that callback, mainly micmic the functionality in core/classes/xmlItem.php on function __set() case 'callback'
$xmlObjFrom | ||
$xmlObjTo | ||
$setting |