Skip to content

Instantly share code, notes, and snippets.

@CarsonF
CarsonF / Translator.php
Created February 19, 2015 00:04
Translator
<?php
namespace Service\Translation;
use Common\Config;
use Common\Log;
use GMO\Common\Collections\ArrayCollection;
use GMO\Common\String;
use Pimple;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Translation\Translator as BaseTranslator;
<?php
if (!isResource()) {
return false;
}
require_once __DIR__ . '/index.php';
function isResource() {
$path = $_SERVER['SCRIPT_NAME'];
@CarsonF
CarsonF / TwigResponse.php
Created January 14, 2015 17:09
Subclassing Response for Twig
<?php
namespace GMO\Common\Web\Twig;
use GMO\Common\Collections\ArrayCollection;
use Symfony\Component\HttpFoundation\Response;
class TwigResponse extends Response {
public function setTemplate($template) {
$this->template = $template;