Programming

Folders and Files

Class & Controller

View

Form

Image

PDF

Chart

Database (Single table)

Database (Relational table)

Sort (Drag and Drop)

Image Upload/Display

File Upload/Download

CSV Upload/Download

Database ( How to retrieve data from database) - Filter

Database ( How to retrieve data from database) - Select

Form

"ajax-link"

"ajax-link" is used to open windows or submit forms.

Submit a Form

The below code example is used to submit a form. You must specify the below attributes.
data-form: Form ID
data-class: Class Name
data-function: Function Name

value: optional
selected: optional
$countries: private array

<form id="form_id">
<p>Your Name</p>
<input type="text" name="user_name" value="{$user_name}" >

<!-- Select Box -->
{html_options name="country" options=$countries selected=$country}

<!-- Radio Buttons -->
{html_radios name="gender" options=$gender_list selected=$gender}
</form>

<button class="ajax-link" data-form="form_id" data-class="helloworld" data-function="save">Send</button>

Read Form Data

function save(Controller $ctl){
$name = $ctl->POST('user_name');

//or
$data = $ctl->POST();
$name = $data['user_name'];
$country= $data['country'];
}

Hidden Inputs

Additional data can be sent without adding hidden input fields.
data-id: must be specified when updating data.
parent_id: can be used to handle relationships.

<button data-id={$user.id} data-parent_id="{$parent_id}" class="ajax-link" data-form="form" data-class="helloworld" data-function="save">send</button>

Datepicker

<input type="text" name="date" value="{$data.date}" class="datepicker">

Colorpicker

<input type="text" name="color" value="{$data.color}" class="colorpicker">

Wordcounter

<textarea name="report" class="wordcounter" data-counter_max="30"></textarea>

FOCUS Business Platform