Problem s prelinkovanim latte sablon
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- cujan
- Člen | 410
tu je presenter…
<?php
namespace App\Presenters;
use Nette,
App\Model;
class EkonomikaPresenter extends BasePresenter {
/** @var Nette\Database\Context */
private $database;
public function __construct(Nette\Database\Context $database)
{
$this->database = $database;
}
/********************* view default *********************/
public function renderDefault()
{
//$this->template->prijmyVydaje = $this->prijmyVydaje->findAll();
}
protected function createComponentGrid($name) {
$grid = new \Grido\Grid($this,$name);
$grid->translator->lang='sk';
$grid->setModel($this->database->table('prijmyVydaje'));
$grid->addColumnDate('datum', 'Datum')->setDateFormat(\Grido\Components\Columns\Date::FORMAT_DATE)->setSortable();
$grid->addColumnText('popis', "Popis");
$grid->addColumnText('suma', "Suma")->setSortable();
$grid->addColumnText('identifikator', 'identifikator');
}
protected function createComponentPolozkaForm($name) {
parent::createComponent($name);
$form = new \Nette\Application\UI\Form;
$form->addText('popis','Popis');
return $form;
}
}