kScript can be used to do full web programming task, and extend the functionality of kooboo. It can do similar things as your normally do with PHP or JSP.
<script engine=kscript> var list = k.database.getTable("tablename").all(); </script> <div k-foreach="item list"> <h2 k-content="item.title">Welcome!</h2> <p k-content="item.summary">Welcome to Kooboo CMS</p> </div>
For reference of kScript, see coding reference charpter.
Types of Backend Script
Navigate to "Development" -- "Code".
You can use kScript to write many type of codes.
Api: Response to client API request, contains a route and response Json.
Datasource: Used on view designer, to provide data source for view binding.
Diagnosis: Used on Diagnosis option to check your website errors.
Event: Used on the Event IF THIS THEN THAT rules.
Job: Schedule task to run on your system.
PageScript: Similiar like a normal Script, but run on server side, with both external and embedded objects.
Click "Create" and select one type of script to create.
There some sample code provided with each type, so that you understand what you can do there.
Some type of code may have configuration, for example, event and datasource.
Click "Configuration" in the button, switch to configuration and follow the sample code to export a config object.
On the left side of coding windows, there is a kScript reference document
Click the button on left top corner of the reference windows, open the reference object list.
Click on each object to go to reference of that object.