nette – Finder – vyhledání souborů a zobrazení vlastností

  use Nette\Utils\Finder;foreach (Finder::findFiles(‘*.jpg’, ‘*.png’)->in($dir) as $key => $file) {      dump(‘getPath: ‘ . $file->getPath());      dump(‘getFileName: ‘ . $file->getFileName());      dump(‘getBasename: ‘ . $file->getBasename());      dump(‘getCTime: ‘ . $file->getCTime());      dump(‘getExtension: ‘ . $file->getExtension());      dump(‘getFileInfo: ‘ . $file->getFileInfo());      dump(‘getFilename: ‘ . $file->getFilename());      dump(‘getGroup: ‘ . $file->getGroup());      dump(‘getInode: ‘ . $file->getInode());      //dump(‘getLinkTarget: ‘ . $file->getLinkTarget());      dump(‘getMTime: ‘ . $file->getMTime());      dump(‘getOwner:…

nette – Nastavení htaccess, pokud www není root

  Order Allow,DenyAllow from allRewriteEngine OnRewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]RewriteRule ^ https://www.EXAMPLE.cz%{REQUEST_URI} [R=301,L]RewriteCond %{HTTP_HOST} ^(www\.)?EXAMPLE\.cz$RewriteRule ^$ /www/ [L]RewriteCond %{HTTP_HOST} ^(www\.)?EXAMPLE\.cz$RewriteRule (.*) /www/$1 [L]  

nette – Get params from neon

  1) app/config/config.neon parameters:             param_1:                     param_2:                             param_3: ‘value’ 2) nette $value = $this->context->parameters[‘param_1’][‘param_2’][‘param_3’]);  

nette – Redirect

  $this->redirect(‘Presenter:action’, $var); $this->redirectPermanent(‘Presenter:action’, $var); $this->redirectUrl(‘https://nejaka.adresa.dom’);

nette – HTTP request

  use Nette\Http\Request; /** @inject @var Request */public $httpRequest; echo $this->httpRequest->getMethod();  

nette – Rewrite from root to www folder

  Update .htacces in root folder of Nette installation: Order Allow,DenyAllow from allRewriteEngine OnRewriteRule ^(.*)$ www/$1 [L] Update or create .htaccess in app, log, temp and venfor folders: Order Allow,DenyDeny from all    

latte – form – Zaškrtnutí prvku pole radio button

 Zaškrtnutí prvku radio podle hodnoty proměnné $platneChecked předané z prezenteru: <form n:name=resHledat class=form>      <label n:name=hledat>Název subjektu nebo (IČO): <input n:name=hledat size=20></label>      &nbsp;&nbsp;&nbsp;      {foreach $form[platne]->items as $key => $label}            <label n:name=”platne:$key”><input n:name=”platne:$key” {if $platneChecked === $key}checked{/if}> {$label}</label>            &nbsp;&nbsp;      {/foreach}      &nbsp;&nbsp;&nbsp;      <input n:name=send class=”btn btn-default”></form>