Zepi/Web/UserInterface/src/Renderer/Table.php
public function prepareTable(WebRequest $request, TableAbstract $table, $paginationUrl, $numberOfEntries = 10)
    {
        // If the table has no pagination we do not limit the number of entries 
        // which will be displayed
        if (!$table->hasPagination()) {
            $numberOfEntries = false;
        }
        
        // Generate the data request
        $dataRequest = $this->generateDataRequest($request, $table, $numberOfEntries);
        
        // Get the data
        $data = $table->getData($dataRequest);
        if (!is_array($data)) {
            $data = array();
        }

        $preparedTable = new PreparedTable($table, $table->getColumns());
        $preparedTable->setOptions($table->getOptions());
        
        // Add the table head
        $preparedTable->setHead($this->renderHead($table, $dataRequest));
        
        // Render the body and add it to the rendered table
        $body = new Body();
        foreach ($data as $object) {
            $body->addRow($this->renderRow($table, $body, $object));
        }
        $preparedTable->setBody($body);
        
        // Add the table foot
        $preparedTable->setFoot($this->renderFoot($table));
        
        // Create the token
        $token = uniqid('dt');
        $preparedTable->setToken($token);
        $request->setSessionData('dt-class-' . $token, get_class($table));
        $request->setSessionData('dt-time-' . $token, time());
        $request->setSessionData('dt-options-' . $token, json_encode($table->getOptions()));
        
        return $preparedTable;
    }
public function prepareTable(WebRequest $request, TableAbstract $table, $paginationUrl, $numberOfEntries = 10)
    {
        // If the table has no pagination we do not limit the number of entries 
        // which will be displayed
        if (!$table->hasPagination()) {
            $numberOfEntries = false;
        }
        
        // Generate the data request
        $dataRequest = $this->generateDataRequest($request, $table, $numberOfEntries);
        
        // Get the data
        $data = $table->getData($dataRequest);
        if (!is_array($data)) {
            $data = array();
        }

        $preparedTable = new PreparedTable($table, $table->getColumns());
        $preparedTable->setOptions($table->getOptions());
        
        // Add the table head
        $preparedTable->setHead($this->renderHead($table, $dataRequest));
        
        // Render the body and add it to the rendered table
        $body = new Body();
        foreach ($data as $object) {
            $body->addRow($this->renderRow($table, $body, $object));
        }
        $preparedTable->setBody($body);
        
        // Add the table foot
        $preparedTable->setFoot($this->renderFoot($table));
        
        // Create the token
        $token = uniqid('dt');
        $preparedTable->setToken($token);
        $request->setSessionData('dt-class-' . $token, get_class($table));
        $request->setSessionData('dt-time-' . $token, time());
        $request->setSessionData('dt-options-' . $token, json_encode($table->getOptions()));
        
        return $preparedTable;
    }
public function prepareTable ( WebRequest $ request , TableAbstract $ table , $ paginationUrl , $ numberOfEntries = 10 ) { // If the table has no pagination we do not limit the number of entries  // which will be displayed if ( ! $ table -> hasPagination ( ) ) { $ numberOfEntries = false ; } // Generate the data request $ dataRequest = $ this -> generateDataRequest ( $ request , $ table , $ numberOfEntries ) ; // Get the data $ data = $ table -> getData ( $ dataRequest ) ; if ( ! is_array ( $ data ) ) { $ data = array ( ) ; } $ preparedTable = new PreparedTable ( $ table , $ table -> getColumns ( ) ) ; $ preparedTable -> setOptions ( $ table -> getOptions ( ) ) ; // Add the table head $ preparedTable -> setHead ( $ this -> renderHead ( $ table , $ dataRequest ) ) ; // Render the body and add it to the rendered table $ body = new Body ( ) ; foreach ( $ data as $ object ) { $ body -> addRow ( $ this -> renderRow ( $ table , $ body , $ object ) ) ; } $ preparedTable -> setBody ( $ body ) ; // Add the table foot $ preparedTable -> setFoot ( $ this -> renderFoot ( $ table ) ) ; // Create the token $ token = uniqid ( 'dt' ) ; $ preparedTable -> setToken ( $ token ) ; $ request -> setSessionData ( 'dt-class-' . $ token , get_class ( $ table ) ) ; $ request -> setSessionData ( 'dt-time-' . $ token , time ( ) ) ; $ request -> setSessionData ( 'dt-options-' . $ token , json_encode ( $ table -> getOptions ( ) ) ) ; return $ preparedTable ; }
Renders the whole table

@access public
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Web\UserInterface\Table\TableAbstract $table
@param string $paginationUrl
@param integer $numberOfEntries
@return \Zepi\Web\UserInterface\Table\PreparedTable
Renders the whole table