Class: Structures_DataGrid_Renderer_Smarty
Source Location: /Structures_DataGrid_Renderer_Smarty-0.1.5/Structures/DataGrid/Renderer/Smarty.php
Structures_DataGrid_Renderer
|
--Structures_DataGrid_Renderer_Smarty
Smarty Rendering Driver
Author(s):
Version:
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
[line 148]
Smarty Rendering Driver SUPPORTED OPTIONS: - selfPath: (string) The complete path for sorting and paging links.
(default: $_SERVER['PHP_SELF'])
- sortingResetsPaging: (bool) Whether sorting HTTP queries reset paging.
- convertEntities: (bool) Whether or not to convert html entities.
This calls htmlspecialchars().
- varPrefix: (string) Prefix for smarty variables and functions
assigned by this driver. Can be used in
conjunction with
Structure_DataGrid::setRequestPrefix() for
displaying several grids on a single page.
- associative: (bool) By default the column set and the records
are numerically indexed arrays. By setting
this option to true the keys will be field
names instead.
SUPPORTED OPERATION MODES: - Container Support: yes
- Output Buffering: yes
- Direct Rendering: no
- Streaming: no
- Object Preserving: yes
GENERAL NOTES: To use this driver you need the Smarty template engine from http://smarty.php.net This driver does not support the render() method, it is only able to: Either fill() a Smarty object by assigning variables and registering the {getPaging} smarty function. It's up to you to call Smarty::display() after the Smarty object has been filled. Or return all variables as a PHP array from getOutput(), for maximum flexibility, so that you can assign them the way you like to your Smarty instance. This driver assigns the following Smarty variables: - $columnSet: array of columns specifications
structure:
array (
0 => array (
'name' => field name,
'label' => column label,
'attributes' => attributes string,
'direction' => 'ASC', 'DESC' or '',
'onclick' => onMove call
),
...
)
- $recordSet: array of records values
- $currentPage: current page (starting from 1 )
- $previousPage: previous page
- $recordLimit: number of rows per page
- $pagesNum: number of pages
- $columnsNum: number of columns
- $recordsNum: number of records in the current page
- $totalRecordsNum: total number of records
- $firstRecord: first record number (starting from 1)
- $lastRecord: last record number (starting from 1)
- $currentSort: array with column names and the directions used for sorting
- $datagrid: a reference that you can pass to {getPaging}
This driver registers a Smarty custom function named getPaging that can be called from Smarty templates with {getPaging} in order to print paging links. This function accepts the same parameters as the pagerOptions option of Structures_DataGrid_Renderer_Pager. {getPaging} accepts an optional "datagrid" parameter which you can pass the $datagrid variable, to display paging for an arbitrary datagrid (useful with multiple dynamic datagrids on a single page). Object Records : this drivers preserves object records if provided. This means that if your datasource provides objects instead of associative arrays as records, you can access their properties and methods in your smarty template, with something like: {$recordSet[col]->getSomeInformation()}.
Method Detail
Documentation generated on Mon, 11 Mar 2019 15:40:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|