PHP Classes
elePHPant
Icontem

Xmodule: Modular Web application development framework

Recommend this page to a friend!
  Info   Videos Videos   View files View files (91)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-10-13 (3 years ago) RSS 2.0 feedNot enough user ratingsTotal: 263 All time: 7,613 This week: 277Up
Version License PHP version Categories
xmodule 2.8GNU General Publi...5.4PHP 5, Libraries
Description Author

This package is a modular Web application development framework.

It allows the development of Web applications by the means of defining different module classes and view template scripts.

Each loaded module returns an object of the respective module class.

The package comes with several built-in modules but custom modules may be added by the developer when necessary. Currently it provides modules for:

- Database access with drivers for many types of databases
- Application text translation,
- Handle REST API requests
- Manipulate current request URLs
- Manage and authenticate application users
- Load and process view templates

  Performance   Level  
Name: Mihajlo Siljanoski <contact>
Classes: 4 packages by
Country: Macedonia Macedonia
Age: 35
All time rank: 15121 in Macedonia Macedonia
Week rank: 677 Up1 in Macedonia Macedonia Equal

 

Details

xmodule

easiest modular PHP framework...

Core modules

Database Database module for easy access database or generating queries via active records. Database connection can be set in app/config.php $db=module('database'); $db will be object with all active records from CodeIgniter Database class <?php

            
$db=module('database');
            
//selecting all posts from posts table
$posts=$db->query("SELECT * FROM posts")->result_array();
            
print_r($posts);
            

?>

        

<?php

            
$db=module('database');
            
//preparing data for insert
$for_insert=array(
    'title'=>'Simple post title',
    'description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...',
    'created'=>date('Y-m-d H:i:s')
);
            
//inserting record in posts table
if($db->insert('posts',$for_insert)){
    echo 'record inserted in database';
}
            

?>

        

EllisLab, Inc. https://ellislab.com/ Language Language module is for easy adding multilanguage site logic. Language files can be stored in "app/languages/" folder and need to be JSON file. $language=module('language'); $language will return object with all keys of language fales and method for loading diferent language. <?php

            
$language=module('language');
            
//loading language file
$language->load('en');
            

?>

        

<?php

            
//init language module
$language=module('language');
            
//loading language file
$language->load('en');
            
//adding language keys in $lang variable
$lang=$language->lang;
            

?>

<h1>

<?php echo $lang->welcome; ?> - <?php echo $lang->site_name; ?>

</h1>

        

Mihajlo Siljanoski https://mk.linkedin.com/in/msiljanoski Rest Rest module will provide JSON response for API services or ajax calls. $rest=module('rest'); $rest will be an object with "response()" method. <?php


//init rest module
$rest=module('rest');

//example of use for regular response
$rest->response(array('msg'=>'User registered!'));
            

?>

        

<?php


//init rest module
$rest=module('rest');

//example of use for error response
$rest->response(array('msg'=>'User already registered!'),false);
            

?>

        

Mihajlo Siljanoski https://mk.linkedin.com/in/msiljanoski URL URL module can be used for URL helping, redirections, handling URI segments etc. $url=module('url'); $url will return object with a lot methods. <?php


//init url module
$url=module('url');

//example of use base_url() method
$url->base_url();

//will return base path of framework instalation ex. http://localhost/mysite/
            

?>

        

<?php


//init url module
$url=module('url');

//example of use current_url() method
$url->current_url();

//will return current url path of currently opened page 
//ex. http://localhost/mysite/products/school/notebook?id=1
            

?>

        

<?php


//init url module
$url=module('url');

//example of use site_url() method
$url->site_url('products/school');

//will return base path with page URI path 
//ex. http://localhost/mysite/products/school
            

?>

        

<?php


//init url module
$url=module('url');

//example of use redirect() method
if(/check for logged user/){
    //some code
}
else{
    $url->redirect('user/login');
}
            

?>

        

<?php


//init url module
$url=module('url');

//example of use segment() method
$url_segment=$url->segment(4);

//if we have url like this http://mypage.com/category/products/school/notebook/cart
//$url_segment will be notebook , 5 will be cart, 2 will be products etc...

                        

?>

        

Mihajlo Siljanoski https://mk.linkedin.com/in/msiljanoski User With User module you can do a lot of things associated with users functionalities. $user=module('user'); $user object will contains following methods: <?php


//init user module , this also will create 2 tables in databse for users
$user=module('user');

//example for creating new user

$new_user = $user->create(
    array(
        'username' => 'testuser',
        'password' => 't35tp@$w0rd',
        //'role'=>'admin',//optional default is 'user'
        'more' => array(  //optional if you like to add dynamicly more infos about that user
            'email'=> 'john.smith@example123.mk',
            'name' => 'John',
            'surname' => 'Smith',
            'address' => 'Partizanski Odredi bb',
            'city' => 'Skopje',
            'country' => 'Macedonia',
            'another_field' => 'bla bla 1',
            'and_another_field' => 'bla bla 2'
        )
    )
);

//now printing inserted user data in database.
//note: password will be stored in db as an md5 hash string 
print_r($new_user);

?>

        

<?php


//init user module 
$user=module('user');

//example for updaing existing user.., very similar as insert
//first parametar is user_id we want to update

$updateduser=$user->update(7,array(
    'more'=>array(
        'another_field'=>false,//to delete from more
        'surname'=>'Smith',//to delete from more
        'name'=>'George'
    )
));

//now printing updated user data in database.
print_r($updateduser);

?>

        

<?php


//init user module 
$user=module('user');

//example for deleting existing user..
//first parametar is user_id we want to delete

$user->delete(4);

?>

        

<?php


//init user module 
$user=module('user');

//example for fatching user/s data from db..
//first parametar is user_id we want to fatch

$oneUser = $user->get(7);

print_r($users);

//example if we like to fatch all users with role "admin"

$users = $user->get('admin','role');

print_r($users);

?>

        

<?php


//init user module 
$user=module('user');

//example for using "is_logged", "auth" and "get_auth_user" methods..
if(!$user->is_logged()){
    if($user->auth('testuser','t35tp@$w0rd')){
        print_r($user->get_auth_user());
    }
    else{
        echo 'auth failed!';
    }
}

?>

        

<?php


//init user module 
$user=module('user');

//init url module
$url=module('url');

//example for using "destroy" user session method..

if($url->segment(2)=='logout'){
    $user->destroy();
    $url->redirect('user/login');
}

?>

        

Mihajlo Siljanoski https://mk.linkedin.com/in/msiljanoski View View module can be used for loading view or parts of view on some page. $view=module('view'); $view will return object with a 2 methods: "load" and "get". Every method has 2 arguments: path to template file and data needs on view. <?php


//init view module
$view=module('view');

//example of use get() method
$content=$view->get('themes/dark/header.php',array('title'=>'Example website'));
echo $content

//example of use load() method
$view->load('themes/dark/header.php',array('content'=>'...example content...'));
            

?>

        

Mihajlo Siljanoski https://mk.linkedin.com/in/msiljanoski

  Files folder image Files  
File Role Description
Files folder imageapp (1 file, 3 directories)
Files folder imagecache (1 directory)
Files folder imagenbproject (2 files)
Files folder imagesystem (1 file, 3 directories)
Files folder imagethemes (1 directory)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file index.php Output Sample output
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
Files folder imagelanguages (2 files)
Files folder imagemodules (1 directory)
Files folder imagepages (2 files)
  Accessible without login Plain text file config.php Conf. Configuration script

  Files folder image Files  /  app  /  languages  
File Role Description
  Accessible without login Plain text file en.json Data Auxiliary data
  Accessible without login Plain text file mk.json Data Auxiliary data

  Files folder image Files  /  app  /  modules  
File Role Description
Files folder imageheader (1 file)

  Files folder image Files  /  app  /  modules  /  header  
File Role Description
  Plain text file header.module.php Class Class source

  Files folder image Files  /  app  /  pages  
File Role Description
  Accessible without login Plain text file 404.php Aux. Auxiliary script
  Accessible without login Plain text file home.php Example Example script

  Files folder image Files  /  cache  
File Role Description
Files folder imagepermanent (1 directory)

  Files folder image Files  /  cache  /  permanent  
File Role Description
Files folder imagejquery (2 files)

  Files folder image Files  /  cache  /  permanent  /  jquery  
File Role Description
  Accessible without login Plain text file 1.12.4.js Data Auxiliary data
  Accessible without login Plain text file 1.8.1.js Data Auxiliary data

  Files folder image Files  /  nbproject  
File Role Description
  Accessible without login Plain text file project.properties Data Auxiliary data
  Accessible without login Plain text file project.xml Data Auxiliary data

  Files folder image Files  /  system  
File Role Description
Files folder imagecore (3 files)
Files folder imagedatabase (7 files, 1 directory)
Files folder imagemodules (13 directories)
  Accessible without login Plain text file init.php Appl. Application script

  Files folder image Files  /  system  /  core  
File Role Description
  Accessible without login Plain text file Common.php Aux. Auxiliary script
  Plain text file fw.php Class Class source
  Accessible without login Plain text file load.php Aux. Auxiliary script

  Files folder image Files  /  system  /  database  
File Role Description
Files folder imagedrivers (10 directories)
  Plain text file DB.php Class Class source
  Plain text file DB_active_rec.php Class Class source
  Plain text file DB_cache.php Class Class source
  Plain text file DB_driver.php Class Class source
  Plain text file DB_forge.php Class Class source
  Plain text file DB_result.php Class Class source
  Plain text file DB_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  
File Role Description
Files folder imagecubrid (4 files)
Files folder imagemssql (4 files)
Files folder imagemysql (4 files)
Files folder imagemysqli (4 files)
Files folder imageoci8 (4 files)
Files folder imageodbc (4 files)
Files folder imagepdo (4 files)
Files folder imagepostgre (4 files)
Files folder imagesqlite (4 files)
Files folder imagesqlsrv (4 files)

  Files folder image Files  /  system  /  database  /  drivers  /  cubrid  
File Role Description
  Plain text file cubrid_driver.php Class Class source
  Plain text file cubrid_forge.php Class Class source
  Plain text file cubrid_result.php Class Class source
  Plain text file cubrid_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  mssql  
File Role Description
  Plain text file mssql_driver.php Class Class source
  Plain text file mssql_forge.php Class Class source
  Plain text file mssql_result.php Class Class source
  Plain text file mssql_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  mysql  
File Role Description
  Plain text file mysql_driver.php Class Class source
  Plain text file mysql_forge.php Class Class source
  Plain text file mysql_result.php Class Class source
  Plain text file mysql_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  mysqli  
File Role Description
  Plain text file mysqli_driver.php Class Class source
  Plain text file mysqli_forge.php Class Class source
  Plain text file mysqli_result.php Class Class source
  Plain text file mysqli_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  oci8  
File Role Description
  Plain text file oci8_driver.php Class Class source
  Plain text file oci8_forge.php Class Class source
  Plain text file oci8_result.php Class Class source
  Plain text file oci8_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  odbc  
File Role Description
  Plain text file odbc_driver.php Class Class source
  Plain text file odbc_forge.php Class Class source
  Plain text file odbc_result.php Class Class source
  Plain text file odbc_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  pdo  
File Role Description
  Plain text file pdo_driver.php Class Class source
  Plain text file pdo_forge.php Class Class source
  Plain text file pdo_result.php Class Class source
  Plain text file pdo_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  postgre  
File Role Description
  Plain text file postgre_driver.php Class Class source
  Plain text file postgre_forge.php Class Class source
  Plain text file postgre_result.php Class Class source
  Plain text file postgre_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  sqlite  
File Role Description
  Plain text file sqlite_driver.php Class Class source
  Plain text file sqlite_forge.php Class Class source
  Plain text file sqlite_result.php Class Class source
  Plain text file sqlite_utility.php Class Class source

  Files folder image Files  /  system  /  database  /  drivers  /  sqlsrv  
File Role Description
  Plain text file sqlsrv_driver.php Class Class source
  Plain text file sqlsrv_forge.php Class Class source
  Plain text file sqlsrv_result.php Class Class source
  Plain text file sqlsrv_utility.php Class Class source

  Files folder image Files  /  system  /  modules  
File Role Description
Files folder imagedatabase (2 files)
Files folder imagedomparser (2 files)
Files folder imageemail (2 files)
Files folder imagegoogletranslate (2 files)
Files folder imagejquery (2 files)
Files folder imagelanguage (2 files)
Files folder imagemessaging (2 files)
Files folder imagerest (2 files)
Files folder imagestorage (2 files)
Files folder imageurl (2 files)
Files folder imageuser (2 files)
Files folder imagevalidation (2 files)
Files folder imageview (2 files)

  Files folder image Files  /  system  /  modules  /  database  
File Role Description
  Plain text file database.module.php Class Class source
  Accessible without login Plain text file info.xml Data Auxiliary data

  Files folder image Files  /  system  /  modules  /  domparser  
File Role Description
  Plain text file domparser.module.php Class Class source
  Accessible without login Plain text file info.xml Example Example script

  Files folder image Files  /  system  /  modules  /  email  
File Role Description
  Plain text file email.module.php Class Class source
  Accessible without login Plain text file info.xml Example Example script

  Files folder image Files  /  system  /  modules  /  googletranslate  
File Role Description
  Plain text file googletranslate.module.php Class New Version 2.6
  Accessible without login Plain text file info.xml Example New Version 2.6

  Files folder image Files  /  system  /  modules  /  jquery  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file jquery.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  language  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file language.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  messaging  
File Role Description
  Accessible without login Plain text file info.xml Example Example script
  Plain text file messaging.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  rest  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file rest.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  storage  
File Role Description
  Accessible without login Plain text file info.xml Example Example script
  Plain text file storage.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  url  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file url.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  user  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file user.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  validation  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file validation.module.php Class Class source

  Files folder image Files  /  system  /  modules  /  view  
File Role Description
  Accessible without login Plain text file info.xml Data Auxiliary data
  Plain text file view.module.php Class Class source

  Files folder image Files  /  themes  
File Role Description
Files folder imagesimple (1 file)

  Files folder image Files  /  themes  /  simple  
File Role Description
  Accessible without login Plain text file home_page.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:263
This week:0
All time:7,613
This week:277Up