public function getDump($v) { $styles = ['default' => 'background-color:white; color:#222; line-height:1.2em; font-weight:normal; font:13px Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:1000; border:0px;', 'num' => 'color:#a71d5d', 'const' => 'color:#795da3', 'str' => 'color:#df5000', 'cchr' => 'color:#222', 'note' => 'color:#a71d5d', 'ref' => 'color:#a0a0a0', 'public' => 'color:#795da3', 'protected' => 'color:#795da3', 'private' => 'color:#795da3', 'meta' => 'color:#b729d9', 'key' => 'color:#df5000', 'index' => 'color:#a71d5d']; ob_start(); $dumper = new \Symfony\Component\VarDumper\Dumper\HtmlDumper(); $dumper->setStyles($styles); $dumper->dump((new \Symfony\Component\VarDumper\Cloner\VarCloner())->cloneVar($v)); //$dumper->dump($v); $result = ob_get_clean(); return $result; }
/** * Gets the 'twig' service. * * This service is shared. * This method always returns the same instance of the service. * * @return \Twig_Environment A Twig_Environment instance */ protected function getTwigService() { $a = $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE); $b = ${($_ = isset($this->services['debug.file_link_formatter']) ? $this->services['debug.file_link_formatter'] : $this->getDebug_FileLinkFormatterService()) && false ?: '_'}; $c = $this->get('request_stack'); $d = new \Symfony\Component\VarDumper\Dumper\HtmlDumper(NULL, 'UTF-8', 0); $d->setDisplayOptions(array('fileLinkFormat' => $b)); $e = new \Symfony\Component\VarDumper\Dumper\HtmlDumper(NULL, 'UTF-8', 1); $e->setDisplayOptions(array('maxStringLength' => 4096, 'fileLinkFormat' => $b)); $f = new \Symfony\Bridge\Twig\AppVariable(); $f->setEnvironment('dev'); $f->setDebug(true); if ($this->has('security.token_storage')) { $f->setTokenStorage($this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE)); } if ($this->has('request_stack')) { $f->setRequestStack($c); } $this->services['twig'] = $instance = new \Twig_Environment($this->get('twig.loader'), array('debug' => true, 'strict_variables' => true, 'exception_controller' => 'twig.controller.exception:showAction', 'form_themes' => array(0 => 'form_div_layout.html.twig'), 'autoescape' => 'name', 'cache' => __DIR__ . '/twig', 'charset' => 'UTF-8', 'paths' => array(), 'date' => array('format' => 'F j, Y H:i', 'interval_format' => '%d days', 'timezone' => NULL), 'number_format' => array('decimals' => 0, 'decimal_point' => '.', 'thousands_separator' => ','))); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\LogoutUrlExtension(${($_ = isset($this->services['security.logout_url_generator']) ? $this->services['security.logout_url_generator'] : $this->getSecurity_LogoutUrlGeneratorService()) && false ?: '_'})); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\SecurityExtension($this->get('security.authorization_checker', ContainerInterface::NULL_ON_INVALID_REFERENCE))); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\ProfilerExtension($this->get('twig.profile'), $a)); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\TranslationExtension($this->get('translator'))); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\AssetExtension($this->get('assets.packages'))); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\CodeExtension($b, $this->targetDirs[3] . '/app', 'UTF-8')); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\RoutingExtension($this->get('router'))); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\YamlExtension()); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\StopwatchExtension($a, true)); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\ExpressionExtension()); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\HttpKernelExtension()); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\HttpFoundationExtension($c, ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'})); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\FormExtension()); $instance->addExtension(new \Twig_Extension_Debug()); $instance->addExtension(new \Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension()); $instance->addExtension(new \Symfony\Bridge\Twig\Extension\DumpExtension($this->get('var_dumper.cloner'), $d)); $instance->addExtension(new \Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension($e)); $instance->addGlobal('app', $f); $instance->addRuntimeLoader(new \Symfony\Bundle\TwigBundle\ContainerAwareRuntimeLoader($this, array('Symfony\\Bridge\\Twig\\Extension\\HttpKernelRuntime' => 'twig.runtime.httpkernel', 'Symfony\\Bridge\\Twig\\Form\\TwigRenderer' => 'twig.form.renderer'), $this->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE))); (new \Symfony\Bundle\TwigBundle\DependencyInjection\Configurator\EnvironmentConfigurator('F j, Y H:i', '%d days', NULL, 0, '.', ','))->configure($instance); return $instance; }