My favorites | Sign in
Project Logo
                
People details
Project owners:
  andresguzf

"Zend Framework DataGrid" is a project / component written in PHP5, specially developed to work with Zend Framework, aims to generate grids or list from a Data Source such Zend_Db_Table, Zend_Db_Select, Zend_Db_Adapter, Propel, Array, and so on. With features like sort columns (sort / order by), pagination and an appropriate render depending on the type of column.

Once you have checkout or downloaded the libraries, you should copy the "Core" folder inside the "library" folder of our project (where is Zend Framework, etc.).

By default uses Zend_View as rendering engine, but its interface leaves open to use with any other render engine such Smarty or even XML or CSV / TXT.

As mentioned above, the render DataGrid uses Zend_View by default, this implies that we must add the script-path view of the DataGrid (grid.phtml) to Zend_View, this could be in the index / Bootstrap or in the init method of our controller:

<?php
class Cms_GridController extends Zend_Controller_Action
{
	public function init()
	{
		$this->view->baseUrl = $this->_request->getBaseUrl();
		$this->view->addScriptPath(Core::getBaseDir() . DIRECTORY_SEPARATOR . 'skins/scripts/datagrid/');
	}
}

In the folder "skins/scripts/datagrid" of the repository you can find the view "grid.phtml", which builds and render the DataGrid. It's necessary to repeat the previous step in order to Zend View understands that the view of DataGrid is in the directory mentioned above. However it could be any other directory, this is only a proposition.

Each column of DataGrid is an object that implements certain interface, each object has some definition in its data type, according to this is how it will be render. Among the types of columns we have the next: String (default), Text (Long Text), Numbers, Options, Links (url) and Actions (View, Edit, Delete). There remains the possibility to add more types of measures to render such as a Date (Date / DateTime), Price (Currency), ComboBox (Select Options) etc.

By default if it's not specified the objects of the columns, we will create these objects according to the columns/fields of Table (Data source).

Examples of use: Example Zend_Db_Table Example Zend_Db_Select Example Zend_Db_Adapter Example propel Example Array DataGrid styles

To see in Spanish

Examples:

Example Zend_Db_Table

Example Zend_Db_Select

Example Zend_Db_Adapter

Example Propel

Example Array

DataGrid styles









Hosted by Google Code