XOME

Brief:

​XOME is Boston Byte's internal framework used for PHP development, It is very easy to create role based system using ​XOME.

​XOME not only provides you code for add, edit, list, delete, activate and deactivate but also provides validation of your web form. You do not require to write code for delete, activate or deactivate in ​XOME . Just by writing some configuration and calling function, you can implement delete, activate or deactivate . You can upload image using ajax or using post back using ​XOME by just calling one function.

You can develop website front end and back end using ​XOME in less time. You can create dynamic menu, pages using existing code. You can create banners using xome. Fetching records from database is also very easy in​ XOME . You need to call just a function of common model with parameters.

Validations is very important while developing project. ​XOME provides you built in validations.

Need:


​As a Web application development company, we were searching for a solution for fast web application development in PHP. There are lots of open source framework/ CMS available, but we didn't find what we exactly were looking for to speed up the development process. So we decided to build an in-house system in PHP. XOME.​

In a world of IT, we are developing lots of project and while developing project, we came to notice that we are using lots of repeated functions. There is a need of creating common functions and calling them at different places instead of creating them from scratch every time. To avoid repeated code and to improve development speed, we have implemented xome.

How It Works:


​We used existing framework (Codeigniter) which uses MVC pattern. We built our framework on top of Codeigniter framework. This includes libraries, basic built in modules for web application development and modules for CMS.​

Suppose you need to create one small system. Just copy the default ​XOME structure and follow following steps -

1. Configure your database in ​XOME (database_credentials.php) as follows -

<?php

// defining default constants which is using for configure the project
// defining DBUSER as user of database which is using for database connectivity
define("DBUSER",'root');
//defining DBPASS as password of database user as mentioned above DBUSER which is using for database connectivity

define("DBPASS",'');
//defining DBHOST as database hostname or ip address which is using for database connectivity
define("DBHOST",'localhost');
//defining database name which is used for the project
define('DATABASE', "demoxome");
//defining Project Folder name

define('FOLDER', "flaty_admin");

?>




2. Open admin_menu.php and add new entry for your module as follows -

$ADMINMENU['dashboard'] = 'Dashboard';

$ADMINMENU['user_menu'] = "User";

$ADMINSUBMENU['user_menu']['user_role'] = "User Role";

$ADMINSUBMENU['user_menu']['user'] = "System User";

$ADMINMENU['demo'] = 'Demo'; //Key is a controller name




3. Create demo.php as controller, demo_model.php as model and in views create demo folder and in that folder
two files as list_demo.php for listing of demos and manage_demo.php to manage add and edit operations.

//demo.php basic structure

<?php

class Demo extends CI_Controller {
//Declaration/assignment of class variables.
  var $controller = "demo";
  var $tableName = "demo";
  var $fieldName = "xpDemo";
  var $pageTitle = "Demo";
  var $preName = "xp_";
  var $pageType = "list";
  var $viewContent = array();
  var $formValues = array();


  public function __construct() {
      parent::__construct();
    }
//write your code here
}

?>

//demo_model.php basic structure
<?php
class Demo_model extends CI_Model {
  var $tablename = "xp_demo";
  var $primaryID = "xpDemoID";
  //write your code here
 }
?>

Here

$controller is a name of controller. It is used to check module permissions, create dynamic URLS related to demo module, load model and views.

$tableName is a name of database table for current module

$fieldName is a name of primary key field name

$pageTitle is a name of title

$preName
 is a prefix of your database table's fields


$pageType is a type of your page(for example - list, add, edit or manage)

$viewContent
 is an array of key and values that you want to render on view


$formValues is an array of key and values that you want to render on form


Benefits:



  •     Speeding up the development process
  •     Reusing code across similar project
  •     Stability
  •     Simplicity
  •     Code Integrity

Podcast

Michael Patterson sat down with the CEO of Boston Byte, Mustapha Shaikh to discuss the significance and rapid digitization of the healthcar...