Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 28 revisions

Category:Libraries

Rapyd Components Library is a set of classes that can help you to develop applications in Code Igniter. Rapyd provide:

[b]Data Presentation Components[/b]

* It has lists, grids, tables
* It has a theme/views system to standardize components layout
* A tag-based function-engine (for easily format field values ... "<substr><#body#>|0|100</substr>.. ")
* An easy way to paginate data (with CI helpers / libraries like uri and pagination)

[b]Data Editing Components[/b]

* A tiny dynamic ORM (DataObject), based on CI Active Record (now with a basic support for relationships)
* Many field classes: input, textarea, editor (tinyMCE), datetime(jscalendar), etc..
* A form class (based on field classes and CI libs, helpers)
* An elegant way to create CRUD interfaces (like CI scaffolding feature, but totally customizable)

[b]Other features[/b]

* A user class (simple with rules)
* A Session Class (PHP)

Image:components.gif

example of DataSet:

[code]

$this->rapyd->load('dataset');

//simply prepare a query in AR (without execute and without "limit") $this->load->library('database'); $this->db->select('article_id, title, body as body'); $this->db->from('articles');

//when DataSet (or an extended class) is instantiated without parameters //it use current active record object (to perform count(*), and a limit select) $dataset = new DataSet(); $dataset->base_url = site_url('cnt/fnc'); $dataset->uri_segment = 3; $dataset->per_page = 5; $dataset->build();

// in the view you need to iterate this array (that is the page "subset" of data) $data["items"] = $dataset->data;

//this is the navigator.. (you can optimize layout like in CI pagination class //but thught $datagrid->parameter $data["navigator"] = $dataset->navigator;

$this->load->view('myview', $data); [/code]

example of DataGrid:

[code]

$this->rapyd->load('datagrid');

//$mixed can be atable name, or a multidim. array, or null //when it's null the DataGrid use current AR DB preset

$datagrid = new DataGrid('Datagrid Name', $mixed); $datagrid->uri_segment = 3; $datagrid->per_page = 5; $datagrid->use_function("substr"); $datagrid->column_detail("Id","<#article_id#>", site_url('cnt/fnc/det/<#article_id#>')); $datagrid->column("Title",'title'); $datagrid->column("Body", "<#body#>|0|100.."); $datagrid->build();

$data["grid"] = $datagrid->output; $data["rapyd_head"] = $this->rapyd->get_head(); //may contain css/js links

$this->load->view('myview', $data); [/code]

example of DataTable:

[code]

$this->rapyd->load('datatable');

$datatable = new DataTable($mixed);
$datatable->per_row = 3;  
$datatable->per_page = 6;
$datatable->use_function("substr"); 

$datatable->cellTemplate = '
<div style="padding:4px">
  <div style="color:#119911; font-weight:bold"><#title#></div>
  This is the body number <substr><#body#>|5|100</substr>
</div>'; 

//or you can use a partial view
//$datatable->cellTemplate = $this->load->view('repetable', null, true);

$datatable->build();

$data["table"] = $datatable->output;
$data["rapyd_head"] = $this->rapyd->get_head();
$this->load->view('myview', $data);

[/code]

example of integration of 2 components to build a filtered / sortable data grid

[code]

$this->rapyd->load("datafilter","datagrid");

$filter = new DataFilter("Article Filter", "articles");
$filter->title = new inputField("Title", "title");
$filter->state = new dropdownField("Public", "public");
$filter->state ->option("","");
$filter->state ->options(array("y"=>"Yes","n"=>"No"));
$filter->buttons("reset","search");    
$filter->build();

$grid = new DataGrid("Article List");
$grid->per_page = 5;
$grid->column_detail("ID","article_id",
  site_url('rapydsamples/dataedit/show/<#article_id#>'));
$grid->column_orderby("title","title","title");
$grid->column("body","body");
$grid->add("rapydsamples/dataedit/create");
$grid->build();

$data["crud"] = $filter->output . $grid->output;

[/code]

..and this is the main rapid component DataEdit, that is a complete crud application to manage a record Basically it extend the DataForm component to manage all editing actions/views

[code] $this->rapyd->load("dataedit");

$edit = new DataEdit("Article Detail", "articles");
$edit->back_url = site_url("rapydsamples/crud");

$edit->title = new inputField("Title", "title");
$edit->title->rule = "trim|required|max_length[20]";

$edit->body = new textareaField("Body", "body");
$edit->body->rule = "required";
$edit->body->rows = 10;    

$edit->checkbox = new checkboxField("Public", "public", "y","n");

$edit->datefield = new dateField("Date", "datefield","eu"); 

$edit->buttons("modify", "save", "undo", "delete", "back");
$edit->build();

$data["edit"] = $edit->output; 

[/code]

There are many other features ...and a tiny user_guide

Online download / Support site: [url]http://www.rapyd.com/[/url]

[h3]P.S.[/h3]

current version : 0.8 based on CI 1.4.1 rapyd support/forum site is online: [url]http://www.rapyd.com/forum[/url]

Last version is: 0.9 (beta2) for CI 1.5.0.1 [url]http://www.rapyd.com/forum/viewtopic.php?id=68[/url]

Clone this wiki locally