Overview

Namespaces

  • App
    • Components
    • Interfaces
    • Lib
      • Files
      • Forms
        • Controls
      • Html
      • Repair
      • Statics
    • Model
    • Modules
      • BaseModule
        • Presenters
      • PartnersModule
        • Presenters
      • ProductModule
        • Presenters
      • SaleModule
        • Model
        • Presenters
      • SettingsModule
        • Model
        • Presenters
      • StoreModule
        • Model
        • Presenters
    • Presenters
    • Router
  • PHP

Classes

  • DateTime
  • SplFileInfo

Interfaces

  • ArrayAccess
  • Countable
  • Exception
  • Iterator
  • Traversable
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Download
 1: <?php
 2: 
 3: /**
 4:  * Project sberp
 5:  *
 6:  * @file table 
 7:  * @author Jaromír Polášek
 8:  * @version 0.7.1.FORM
 9:  * Encoding UTF-8
10:  */
11: 
12: namespace App\Components;
13: 
14: use Nette,
15:     App\Lib\Html;
16: 
17: /**
18:  * Komponenta pro generování Datagridu
19:  */
20: class TableControl extends Component {
21: 
22:     /** @var \App\Lib\Html\Table  Html kó tabulky */
23:     private $table;
24: 
25:     /**
26:      * Vrací Html kód Tabulky
27:      * @return string (\Nette\Utils\Html)
28:      */
29:     public function create() {
30:     return $this->table->code;
31:     }
32: 
33:     /**
34:      * Předává tabulce parametr s odkazem aktuální prezenter. Dokud není nastaven, 
35:      * třída negeneruje komponentu. Po nastavení parametru se kontrolují přístupová práva.
36:      * @param string $params URL
37:      * @throws Nette\InvalidArgumentException
38:      */
39:     public function setParams($params) {
40:     parent::setParams($params);
41:     if ($this->action->state) {
42:         if (is_array($params)){
43:         $data = $this->action->relevance;
44:         $fields = $this->action->getRelevancestruct()->column;
45:         $params = $params['link'];
46:         }else{
47:         $fields = $this->action->table->column;
48:         $data = $this->action->data->data;
49:         }       
50:         $this->table = new Html\Table($params, $fields, $data, $this->action->table->footer, ($this->name)); 
51:     } else {
52:         throw new Nette\InvalidArgumentException('Parametry akce nejsou nadefinovány');
53:     }
54:     }
55: }
56: 
sberp API API documentation generated by ApiGen