PHP Application

DbFace application script.

If the other report types not work for you. You can define your own reports by PHP coding.

DbFace’s PHP development environment is based on CodeIgniter Framework, so you can benefit from all CodeIgniter features especially the Database Active Record.

You can get more information from CodeIgniter Documentation.

Build PHP Application

Sign in DbFace with Administrator or Developer account. Click the “PHP Application” button in the “Visualization” section. DbFace workspace will show you PHP code editor.

Input your PHP code, and press CTRL + Enter or click Preview button to preview the PHP application.

Controller-View Application

DbFace already integrates Smarty template engine.

Create smarty template

Tap Settings -> Cloud Code to enter cloud code page, click the “Create Template” button to create new smarty template: Create Smarty template in DbFace

Here, we build a simple sample Smarty template, we use [{}] as the variable delimiter:

Sample Smarty template

Use smarty template in PHP Application

<?php
  $smarty->assign('variable', 'Hello world!');
  $smarty->display('sample.tpl');
?>

The application result:
Sample Controller-View PHP application in DbFace


Last modified January 3, 2021: fix (fdabe16)