Skip to content

Instantly share code, notes, and snippets.

@bogomolov-dev
Last active August 29, 2015 14:12
Show Gist options
  • Save bogomolov-dev/58fed13de507c8bb67f3 to your computer and use it in GitHub Desktop.
Save bogomolov-dev/58fed13de507c8bb67f3 to your computer and use it in GitHub Desktop.
VarDumper - Neue Komponente in Symfony 2.6
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
// ...
}
}
// ...
}
composer require --dev tchwork/debug-bundle
composer require symfony/var-dumper
<?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction(Request $request)
{
dump($this->container, $request);
}
}
{% extends '::base.html.twig' %}
{% block body -%}
{% dump entity %}
{{ dump(entity) }}
{% endblock %}
<?php
require_once '../vendor/autoload.php';
$var = ['foo', new \stdClass(), 10, new \DateTime()];
dump($var);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment