Lister::render PHP Метод

render() публичный Метод

Renders everything.
public render ( )
    public function render()
    {
        $iter = $this->getIterator();
        foreach ($iter as $this->current_id => $this->current_row) {
            if ($this->current_row instanceof Model) {
                /** @type Model $this->current_row */
                $this->current_row = $this->current_row->get();
            } elseif (!is_array($this->current_row) && !$this->current_row instanceof ArrayAccess) {
                // Looks like we won't be able to access current_row as array, so we will
                // copy it's value inside $this->current instead and produce an empty array
                // to be filled out by a custom iterators
                $this->current = $this->current_row;
                $this->current_row = get_object_vars($this->current);
            }
            $this->formatRow();
            $this->output($this->rowRender($this->template));
        }
    }

Usage Example

Пример #1
0
function render_admin_listarusuarios($param)
{
    require_once "lister.php";
    $sf = vwVarFromInput('sf');
    $start = vwVarFromInput('start');
    $up = vwVarFromInput('up');
    list($db) = Getdb();
    $tblusuarios = GetTable('usuarios');
    $colsusuarios = GetCols('usuarios');
    $sql = "Select * from {$tblusuarios}";
    $Cols = array(array("dbname" => $colsusuarios['uid'], "label" => "id", "width" => "45px", "sortable" => false), array("dbname" => $colsusuarios['uname'], "label" => "Usuario", "width" => "80px", "sortable" => false), array("dbname" => $colsusuarios['nombre'], "label" => "Nombre", "width" => "100px", "sortable" => true), array("dbname" => $colsusuarios['apellidos'], "label" => "Apellidos", "width" => "120px", "sortable" => true), array("dbname" => $colsusuarios['nivel'], "label" => "Nivel", "width" => "45px", "sortable" => false));
    $opciones = array(array("funcion" => "cbUserPromote", "valor" => "{$colsusuarios['nivel']}"), array("funcion" => "cbUserEdit", "valor" => "{$colsusuarios['uid']}"), array("funcion" => "cbUserDelete", "valor" => "{$colsusuarios['uid']}"), array("funcion" => "cbUserMasInfo", "valor" => "{$colsusuarios['uid']}"));
    $acciones = array(array('funcion' => "cbUserAdmAdd"));
    $userList = new Lister("admUsuarios", $sql, 25, $Cols, $colsusuarios['uid'], $opciones, "dg-admusers.css");
    $userList->table = "{$table}";
    $userList->where = "";
    $userList->GeneralActions = $acciones;
    if ($sf != "") {
        $userList->SetSort($sf, $up);
    }
    if ($start != "") {
        $userList->SetStart($start);
    }
    $listado = $userList->render();
    $resultado = SmartyInit();
    $plantilla = "usuarios/listusers.tpl";
    $resultado->assign("listado", $listado);
    $salida = $resultado->fetch($plantilla);
    vwSessionSetVar('urlantigua', CurrentUrl());
    return $salida;
}
All Usage Examples Of Lister::render