<?php
$article->getOne(); $article->one;
$article->getTwo(); $article->two;
$article->getThree(); $article->three;
This file contains 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\Routers\RouteList, | |
Nette\Application\Routers\Route, | |
Nette\Application\Routers\SimpleRouter; | |
use Nette\Utils\Strings; | |
/** | |
* Router factory. |
This file contains 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 | |
/** | |
* This file is part of the Kdyby (http://www.kdyby.org) | |
* | |
* Copyright (c) 2008, 2012 Filip Procházka (filip@prochazka.su) | |
* | |
* For the full copyright and license information, please view the file license.txt that was distributed with this source code. | |
*/ |
This file contains 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 | |
// .phpstorm.meta.php | |
namespace NEON_META { // we want to avoid the pollution | |
$CONFIG_KEYS = [ | |
'dibi' => [ 'host' => '', 'dbname' => '', 'user' => '', 'password' => '' ], // unobstrusive static definition | |
'nette' => \Nette\Config\Extensions\NetteExtension::$defaults, // no problem the property is actually not static | |
'nette' => [ | |
'session' => [ |
This file contains 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 BasePresenter extends UI\Presenter | |
{ | |
/** | |
* Returns destination as Link object. | |
* @param string destination in format "[[module:]presenter:]view" or "signal!" |
This file contains 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 | |
/** | |
* Třída existuje, aby se vůbec neukládala session, tam kde není potřeba. | |
* Například v API, nebo v Cronu se různě sahá na session, i když se reálně mezi requesty nepřenáší. | |
* | |
* @internal | |
*/ | |
class ArraySessionStorage extends Nette\Object implements Nette\Http\ISessionStorage | |
{ |
To je komponenta, která pouze zpracovává signál a vytváří odkazy systémovým způsobem, díky napojení na presenter.
<?php
protected function createComponentFbLogin()
{
$dialog = $this->facebook->createDialog('login');
/** @var LoginDialog $dialog */
$dialog->onResponse[] = $this->facebookLoginResponse;
This file contains 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 | |
function handle($throw = FALSE) | |
{ | |
try { | |
try { | |
throw new \LogicException('invalid xml'); | |
} catch (\Exception $e) { | |
throw new \LogicException('', 0, $e); // wrap |
This file contains 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 | |
Finder::extensionMethod('sort', function (Finder $finder, $callback) { | |
$result = iterator_to_array($finder); | |
uasort($result, $callback); | |
return new \ArrayIterator($result); | |
}); | |
$index = Finder::find('*')->in($dir)->sort(function (\SplFileInfo $a, \SplFileInfo $b) { | |
return $a->isDir() ? ($b->isDir() ? strnatcasecmp($a->getBasename(), $b->getBasename()) : -1) |
This file contains 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 | |
/** | |
* This file is part of the Kdyby (http://www.kdyby.org) | |
* | |
* Copyright (c) 2008, 2012 Filip Procházka (filip@prochazka.su) | |
* | |
* For the full copyright and license information, please view the file license.txt that was distributed with this source code. | |
*/ |