Recommend this page to a friend! |
Download .zip |
Info | Videos | View files (91) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 267 This week: 1 | All time: 7,614 This week: 283 |
Version | License | PHP version | Categories | |||
xmodule 2.8 | GNU General Publi... | 5.4 | PHP 5, Libraries |
Description | Author | ||||||||
This package is a modular Web application development framework. |
|
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
Videos | ||
Files | / | app |
File | Role | Description | ||
---|---|---|---|---|
languages (2 files) | ||||
modules (1 directory) | ||||
pages (2 files) | ||||
config.php | Conf. | Configuration script |
Files | / | nbproject |
File | Role | Description |
---|---|---|
project.properties | Data | Auxiliary data |
project.xml | Data | Auxiliary data |
Files | / | system |
Files | / | system | / | core |
File | Role | Description |
---|---|---|
Common.php | Aux. | Auxiliary script |
fw.php | Class | Class source |
load.php | Aux. | Auxiliary script |
Files | / | system | / | database |
File | Role | Description | ||
---|---|---|---|---|
drivers (10 directories) | ||||
DB.php | Class | Class source | ||
DB_active_rec.php | Class | Class source | ||
DB_cache.php | Class | Class source | ||
DB_driver.php | Class | Class source | ||
DB_forge.php | Class | Class source | ||
DB_result.php | Class | Class source | ||
DB_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | cubrid |
File | Role | Description |
---|---|---|
cubrid_driver.php | Class | Class source |
cubrid_forge.php | Class | Class source |
cubrid_result.php | Class | Class source |
cubrid_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | mssql |
File | Role | Description |
---|---|---|
mssql_driver.php | Class | Class source |
mssql_forge.php | Class | Class source |
mssql_result.php | Class | Class source |
mssql_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | mysql |
File | Role | Description |
---|---|---|
mysql_driver.php | Class | Class source |
mysql_forge.php | Class | Class source |
mysql_result.php | Class | Class source |
mysql_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | mysqli |
File | Role | Description |
---|---|---|
mysqli_driver.php | Class | Class source |
mysqli_forge.php | Class | Class source |
mysqli_result.php | Class | Class source |
mysqli_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | oci8 |
File | Role | Description |
---|---|---|
oci8_driver.php | Class | Class source |
oci8_forge.php | Class | Class source |
oci8_result.php | Class | Class source |
oci8_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | odbc |
File | Role | Description |
---|---|---|
odbc_driver.php | Class | Class source |
odbc_forge.php | Class | Class source |
odbc_result.php | Class | Class source |
odbc_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | pdo |
File | Role | Description |
---|---|---|
pdo_driver.php | Class | Class source |
pdo_forge.php | Class | Class source |
pdo_result.php | Class | Class source |
pdo_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | postgre |
File | Role | Description |
---|---|---|
postgre_driver.php | Class | Class source |
postgre_forge.php | Class | Class source |
postgre_result.php | Class | Class source |
postgre_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | sqlite |
File | Role | Description |
---|---|---|
sqlite_driver.php | Class | Class source |
sqlite_forge.php | Class | Class source |
sqlite_result.php | Class | Class source |
sqlite_utility.php | Class | Class source |
Files | / | system | / | database | / | drivers | / | sqlsrv |
File | Role | Description |
---|---|---|
sqlsrv_driver.php | Class | Class source |
sqlsrv_forge.php | Class | Class source |
sqlsrv_result.php | Class | Class source |
sqlsrv_utility.php | Class | Class source |
Files | / | system | / | modules | / | database |
File | Role | Description |
---|---|---|
database.module.php | Class | Class source |
info.xml | Data | Auxiliary data |
Files | / | system | / | modules | / | domparser |
File | Role | Description |
---|---|---|
domparser.module.php | Class | Class source |
info.xml | Example | Example script |
Files | / | system | / | modules | / |
File | Role | Description |
---|---|---|
email.module.php | Class | Class source |
info.xml | Example | Example script |
Files | / | system | / | modules | / | googletranslate |
File | Role | Description |
---|---|---|
googletranslate.module.php | Class | New Version 2.6 |
info.xml | Example | New Version 2.6 |
Files | / | system | / | modules | / | jquery |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
jquery.module.php | Class | Class source |
Files | / | system | / | modules | / | language |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
language.module.php | Class | Class source |
Files | / | system | / | modules | / | messaging |
File | Role | Description |
---|---|---|
info.xml | Example | Example script |
messaging.module.php | Class | Class source |
Files | / | system | / | modules | / | rest |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
rest.module.php | Class | Class source |
Files | / | system | / | modules | / | storage |
File | Role | Description |
---|---|---|
info.xml | Example | Example script |
storage.module.php | Class | Class source |
Files | / | system | / | modules | / | url |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
url.module.php | Class | Class source |
Files | / | system | / | modules | / | user |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
user.module.php | Class | Class source |
Files | / | system | / | modules | / | validation |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
validation.module.php | Class | Class source |
Files | / | system | / | modules | / | view |
File | Role | Description |
---|---|---|
info.xml | Data | Auxiliary data |
view.module.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
Xmodule Framework documentation |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
xCRUD - Tutorial Tutorial - How to easy create user management via PHP Xmodule v2.7 |