This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model | |
{ | |
protected $name = 'toto'; | |
public function getName() | |
{ | |
return $this->name; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PageController extends Controller | |
{ | |
public function catchAllAction() | |
{ | |
$pathInfo = $this->get('request')->getPathInfo(); | |
$snapshotManager = $this->get('sonata.page.manager.snapshot'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Form/ChoiceList/ModelChoiceList.php b/Form/ChoiceList/ModelChoiceList.php | |
index e67befd..f95ca6d 100644 | |
--- a/Form/ChoiceList/ModelChoiceList.php | |
+++ b/Form/ChoiceList/ModelChoiceList.php | |
@@ -111,7 +111,7 @@ class ModelChoiceList extends ArrayChoiceList | |
{ | |
parent::load(); | |
- if ($this->choices) { | |
+ if (is_array($this->choices)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Sonata project. | |
* | |
* (c) Thomas Rabaix <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sonata\PageBundle\Block; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Form\Form; | |
use Sonata\AdminBundle\Form\FormMapper; | |
use Sonata\PageBundle\Model\BlockInterface; | |
use Sonata\PageBundle\Model\PageInterface; | |
use Sonata\AdminBundle\Validator\ErrorElement; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// simulate an association ... | |
$fieldDescription = $formMapper->getAdmin()->getModelManager()->getNewFieldDescriptionInstance($this->mediaAdmin->getClass(), 'media' ); | |
$fieldDescription->setAssociationAdmin($this->getMediaAdmin()); | |
$fieldDescription->setAdmin($formMapper->getAdmin()); | |
$fieldDescription->setOption('edit', 'list'); | |
$fieldDescription->setAssociationMapping(array('fieldName' => 'media', 'type' => \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_ONE)); | |
// create the builder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a heading 1 | |
## This is a heading 2 | |
Let's include a media from the SonataMediaBundle : | |
<center> | |
<% media 3, 'small' %> | |
</center> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash-3.2$ ./drush default cc | |
[Symfony2] Booting Kernel ... ok! | |
[Symfony2] Loading container ... ok! | |
Enter a number to choose which cache to clear. | |
[0] : Cancel | |
[1] : all | |
[2] : theme registry | |
[3] : menu | |
[4] : css+js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## The Sonata Formatter Bundle | |
The formatter bundle allows to format a text in different format : | |
* markdown | |
* nl2br | |
* raw html | |
More formatter can be added as long as the correct interface is respected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# more information can be found here http://sonata-project.org/bundles/page | |
# | |
sonata_seo: | |
default: sonata.seo.page.default | |
title: Sonata Project | |
metas: | |
name: | |
keywords: foo bar | |
description: The description |