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 | |
$dao = $em->getDao(Article::class); | |
$allArticles = $dao->findAll(); | |
$filteredAndSorted = $dao->findBy(['category' => $category], ['title' => 'asc']); | |
$singleByFilter = $dao->findOneBy(['title' => 'Foo bar']); | |
$single = $dao->find(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 | |
$route = new Route("...", array( | |
"presenter" => "Foo", | |
"action" => "default", | |
NULL => array( | |
Route::FILTER_IN => function(array $params) { | |
//upravim parametry jak potrebuju, pripadne muzu vratit NULL pro zamitnuti routy | |
return $params; //pokud vse ok | |
}, |
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
extensions: | |
setup: Librette\Setup\SetupExtension | |
setup: | |
#nastavi sitename na vsech presenterech, ktery dedi od BasePresenteru a jsou registrovany v DIC | |
- | |
type: [App\BasePresenter] | |
setup: | |
- setSiteName('example.com') | |
#zapne inject na vsech komponentach (i tech, ktere jsou vytvareny gen. tovarnickou), ktere dedi od BaseControlu | |
- |
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 | |
} | |
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 | |
$this->redrawControl('snippet-nested-sub2'); |
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
uglify: { | |
options: { | |
compress: false, | |
sourceMap: true | |
}, | |
front: { | |
files: { | |
'./www/dist/front/output.js': [ | |
"./www/vendor/jquery/dist/jquery.js", | |
"./www/vendor/nette.ajax.js/nette.ajax.js", |
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
{snippetArea form} | |
{form myForm} | |
{inlineSnippet name} | |
{input name} | |
{/inlineSnippet} | |
{input ok} | |
{/form} | |
{/snippetArea} | |
<a n:href="redraw!" class="ajax">prekresli</a> |
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 IUserAccessor | |
{ | |
/** | |
* @return \Nette\Security\User | |
*/ | |
public function get(); | |
} |
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 | |
public function beforeCompile() | |
{ | |
$builder = $this->getContainerBuilder(); | |
$targetServiceDef = $builder->getDefinition($this->prefix('serviceName')); | |
foreach ($builder->findByTag('myTag') as $name => $attrs) { | |
$def = $builder->getDefinition($name); | |
$targetServideDef->addSetup('addFoo', array($def)); | |
} |
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\Http\Request; | |
class RefUrlFactory extends Object | |
{ | |
/** @var \Nette\Http\Url */ | |
protected $fallbackUrl; | |
/** @var \Nette\Http\Request */ |