Ejemplo n.º 1
0
 /**
  * @param string $category
  * @param string $message
  * @param array $params
  */
 public function functionTranslate($category, $message, array $params = [])
 {
     return Application::getService('Translator')->translate($category, $message, $params);
 }
Ejemplo n.º 2
0
<?php

/*
 * This file is part of Herbie.
 *
 * (c) Thomas Breuss <www.tebe.ch>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
return new Twig_SimpleFunction('githublink', function () {
    $page = \Herbie\Application::getPage();
    $href = 'https://github.com/getherbie/website/blob/master/site/' . str_replace(['@page', '@post'], ['pages', 'posts'], $page->path);
    return '<a class="github-edit-link" href="' . $href . '" title="Fehler entdeckt? Bearbeite den Text auf Github!" target="_blank"><i class="fa fa-2x fa-github"></i></a>';
}, ['is_safe' => ['html']]);
Ejemplo n.º 3
0
 /**
  * @return array
  */
 private function getContext()
 {
     return ['route' => Application::getService('Request')->getRoute(), 'baseUrl' => Application::getService('Request')->getBasePath(), 'theme' => $this->config->get('theme')];
 }
Ejemplo n.º 4
0
 protected function getService($name)
 {
     return \Herbie\Application::getService($name);
 }
Ejemplo n.º 5
0
 /**
  * @return array
  */
 private function getContext()
 {
     // @todo Inject request object or refactor code
     return ['route' => Application::getService('Request')->getRoute(), 'baseUrl' => Application::getService('Request')->getBasePath(), 'theme' => $this->config->get('theme')];
 }