Skip to content

Instantly share code, notes, and snippets.

<?php
class Hello extends Trait
{
public function greet()
{
echo 'Hello, ' . $this->name . $this->getMark();
}
protected function getFrenchMark()
<?php
class PresenterLoader extends \Nette\Application\PresenterLoader
{
public $baseNamespace = 'PandaWeb';
public $caseSensitive = TRUE;
private $baseDir;
<?php
public function loadHttpData()
{
$name = $this->getName();
if (isset($this->getForm()->httpData[$name])) {
if (isset($this->getForm()->httpData[$name]['token'])) {
$this->token = $this->getForm()->httpData[$name]['token'];
$this->files = self::getTempStorage()->getFileList($this->token);
}
if (count($this->files) == NULL && $this->getForm()->httpData[$name]['files'][0] instanceof HttpUploadedFile)
<?php
$iterator = new \DirectoryIterator($dir);
foreach ($iterator as $file) {
/* @var $file \SplFileInfo */
}
<?php
class MyDataSource extends DibiDataSource
{
public function getResult()
{
$result = parent::getResult();
$result->setRowClass('<CLASS>');
return $result;
}
<?php
class SomePresenter extends BasePresenter
{
/** @var DibiRow */
private $item;
/** @var SessionNamespace */
private $session;
<?php
class TestPresenter extends BasePresenter
{
/**
* @var DibiResult
*/
protected $items;
public function actionDefault()
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
<?php
// ...
dibi::connect(array(
// ...
'profiler' => TRUE
// ...
));
<?php
final class HomePresenter extends BasePresenter{
protected function startup(){
parent::startup();
$this->template->test = 'TestStartup';
}
public function createComponentForm(){
$form = new AppForm();