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 | |
declare(strict_types=1); | |
namespace App\Twig\Extension; | |
use Twig\Environment; | |
use Twig\Extension\AbstractExtension; | |
use Twig\TwigFunction; | |
class ExampleComponentExtension extends AbstractExtension | |
{ |
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 | |
$configurator = new Nette\Config\Configurator; | |
$configurator->enableDebugger(__DIR__ . '/log'); | |
$configurator->setTempDirectory(__DIR__ . '/temp'); | |
if(\Tracy\Debugger::$productionMode === TRUE) { | |
set_error_handler(function($severity, $message, $file, $line, $context) { | |
\Tracy\Debugger::log("$message in $file:$line", \Tracy\Debugger::ERROR); | |
$e = new ErrorException($message, 0, $severity, $file, $line); |
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
services: | |
HomepagePresenter: | |
class: FrontModule\HomepagePresenter() | |
setup: | |
- $tempPath(%tempPath%) | |
#nebo | |
- FrontModule\HomepagePresenter() |
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
$array = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); | |
$restart = TRUE; | |
while (list($key, $value) = each($array)) { | |
if($key === 5 && $restart) { | |
prev($array); | |
$restart = FALSE; | |
} | |
var_dump($key); |
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
** Public API v2 ** | |
Usage: | |
The API follows the general pattern of enumerating possible values of the | |
subsequent path segment, with the fully qualified path yielding a json object | |
of the type being enumerated. | |
For example, /v2/colors will yield: | |
[1, 2, 3, ... ] |
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\InvalidLinkException; | |
use Nette\Application\UI\Presenter; | |
use Tracy\Debugger; | |
abstract class BasePresenter extends Presenter { | |
/** | |
* @param InvalidLinkException $e |
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
<div n:if="count($flashes) > 0" n:foreach="$flashes as $flash" role="alert" class="alert alert-{$flash->type}"> | |
{$flash->message} | |
</div> | |
<div n:foreach="$flashes as $flash" class="alert alert-{$flash->type}"> | |
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
{$flash->message} | |
</div> | |
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 | |
$form = new Form(); | |
$form->addSubmit('submit', NULL) | |
->setAttribute("title", "vložení do košíku") | |
->setAttribute("alt", "vložení do košíku"); | |
$vybratBtn = $form['submit']->getControlPrototype(); | |
$vybratBtn->setName("button"); | |
$vybratBtn->type = 'submit'; | |
$vybratBtn->create('i class="fa fa-shopping-cart"'); |
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
{control test:HTML} | |
{control test: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
<?php | |
namespace Model; | |
use Exception; | |
use Nette\DI\Config\Adapters\NeonAdapter; | |
use Nette\IOException; | |
use Nette\Utils\Neon; | |
/** | |
* Description of NeonBuilder |
NewerOlder