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 | |
class MyFormFactory | |
{ | |
public function create(BusinessCard $card) | |
{ | |
$form = new Form; | |
$form->addText(...); | |
$form->onSuccess[] = function ($form) use ($card) { | |
$this->processForm($form, $card); |
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 | |
class RouterFactory | |
{ | |
public /* static */ function createRouter() | |
{ | |
$router = new Nette\Application\Routers\RouteList(); | |
$router[] = $adminRouter = new Nette\Application\Routers\RouteList("Admin"); |
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 | |
interface MessageFactory | |
{ | |
/** | |
* @return \Nette\Mail\Message | |
*/ | |
public function create(); | |
} |
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 | |
/** @var string @persistent */ | |
public $_backlink; | |
public function link($destination, $args = []) | |
{ | |
$modifiers = []; | |
if (($pos = strrpos($destination, ')')) !== FALSE) { | |
$modifiers = array_fill_keys(explode(')(', substr($destination, 1, $pos - 1)), TRUE); | |
$destination = substr($destination, $pos + 1); |
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 | |
class Foo | |
{ | |
public function __construct($id, FooModel $fooModel) | |
{ | |
... | |
} | |
} |
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
local key = KEYS[1] | |
local val = redis.call("get", key) | |
if val == nil then | |
return nil | |
end | |
local tags = redis.call('sMembers', "Nette.Journal:" .. key .. ":tags") | |
local expirations = redis.call("hMGet", "invalidations", unpack(tags)) | |
local added = nil |
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 | |
class Context extends \Nette\Database\Context | |
{ | |
protected $prefix = ""; | |
public function setPrefix($prefix) | |
{ | |
$this->prefix = $prefix; |
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 | |
class SecuredPresneter extends BasePresenter | |
{ | |
public function checkRequirements($element) | |
{ | |
$this->user->storage->setNamespace('admin'); //stejny jako v configu | |
if (!$this->getUser()->isLoggedIn()) { | |
$this->redirect($this->getLoginPage()); //nejaka tvoje kontrola | |
} | |
} |
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 ?>?xml version="1.0" encoding="UTF-8"?> | |
<coverage generated="<?php echo time(); ?>"> | |
<project> | |
<?php foreach ($files as $id => $info): ?> | |
<file name="<?php echo htmlspecialchars($info->file); ?>"> | |
<?php foreach ($info->lines as $line => $arg): if($arg < -1) continue; ?> | |
<line num="<?php echo intval($line); ?>" count="<?php echo $arg >= 1 ? 1 : 0 ?>"/> | |
<?php endforeach; ?> | |
</file> | |
<?php endforeach; ?> |