Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Presenters;
- use Nette;
- class BasePresenter extends Nette\Application\UI\Presenter {
- protected function startup() {
- parent::startup();
- $this->template->developerBar = $this->context->parameters['settings']['developerBar'];
- $this->template->facebookAppId = $this->context->parameters['facebook']['appId'];
- }
- public function createTemplate($class = NULL){
- $template = parent::createTemplate($class);
- $template->addFilter('czechdateproject', function($date){
- $czechMonths = ['Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'];
- return $czechMonths[$date->format('n') - 1];
- });
- $template->addFilter('czechdatebusiness', function($date){
- $czechMonths = ['Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'];
- return $czechMonths[$date->format('n') - 1];
- });
- $template->addFilter('readTime', function($text){
- return floor(str_word_count(strip_tags(trim($text))) / 160);
- });
- $template->addFilter('numberZip', function($number){
- $zipcode = substr($number, 0, 3)." ".substr($number, 3, 2);
- return $zipcode;
- });
- return $template;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement