You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tobiasz.cudnik edited this page Oct 23, 2008
·
2 revisions
labels Plugin
ScriptsPlugin simplifies writing short code scripts which can be easily reused (chained). It removes plugin overhead allowing script to be one-line command.
Using scripts
Before using any script, you need to load *Scripts* plugin, like so:
After that, any available script can be used thou *script* method.
Writing scripts
Scripts are placed in */phpQuery/plugins/Scripts*. Each script has it's own file. Each file has access to 4 variables:
* *$self* Represents $this
* *$params* Represents parameters passed to script() method (without script name)
* *$return* If not null, will be used as method result
* *$config* Content of __config.php file