Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Fix configuration settings order #345

Merged
merged 1 commit into from
May 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions Block/TreeBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Sonata\BlockBundle\Model\BlockInterface;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TreeBlockService extends BaseBlockService
Expand Down Expand Up @@ -65,10 +66,10 @@ public function execute(BlockContextInterface $blockContext, Response $response
public function setDefaultSettings(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'template' => 'SonataDoctrinePHPCRAdminBundle:Block:tree.html.twig',
'id' => '/',
'selected' => null,
'routing_defaults' => $this->defaults,
'template' => function (Options $options, $value) { return $value ?: 'SonataDoctrinePHPCRAdminBundle:Block:tree.html.twig'; },
'id' => function (Options $options, $value) { return $value ?: '/'; },
'selected' => function (Options $options, $value) { return $value ?: null; },
'routing_defaults' => function (Options $options, $value) { return $value ?: $this->defaults; },
));
}

Expand Down