Created
August 12, 2014 10:41
-
-
Save matej21/5e2f96b69f54558724f9 to your computer and use it in GitHub Desktop.
komponenty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Nette\Application\UI; | |
class FooControl extends UI\Control | |
{ | |
public function __construct(...) | |
{ | |
//predani parametru a zavislosti | |
} | |
public function attached($presenter) | |
{ | |
parent::attached($presenter); //nezapomenout zavolat | |
if($presenter instanceof UI\Presenter) { //jelikoz to muze byt i necho jinyho | |
//tady nejdriv muzes pracovat s presenterem - vytvaret linky, plnit sablonu.... | |
} | |
} | |
public function handleFoo($bar) //zpracovani signalu foo s parametrem bar | |
{ | |
//... | |
} | |
public function render() | |
{ | |
$this->template->... | |
$this->template->render(); | |
} | |
/* | |
jeste existujou pohledy pro komponenty, ale ty nedoporucuju, nefungujou s ajaxem | |
vykreslujou se pomoci {control foo:view} | |
v {control} muzes i predavat parametry, {control foo $xx, $yy} ale taky nedoporucuju, stejny problem jako s view | |
*/ | |
public function renderView() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment