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
<div> | |
<form method="POST"> | |
{{ form_widget(form.media.binaryContent, {'attr': {'class': 'span8'}}) }} | |
{{ form_rest(form) }} | |
<input type="submit" class="btn" value="Preview Video"/> | |
</form> | |
</div> |
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\Bundle\DemoBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sonata\Bundle\DemoBundle\Model\MediaPreview; | |
use Symfony\Component\HttpFoundation\Request; | |
class DemoController extends Controller | |
{ |
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
<html> | |
<head {{ sonata_seo_head_attributes() }}> | |
{{ sonata_seo_title() }} | |
{{ sonata_seo_metadatas() }} | |
</head> | |
<body class="sonata-bc"> | |
<!-- page --> |
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 PostController extends Controller | |
{ | |
/** | |
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | |
* @param $permalink | |
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response | |
*/ | |
public function viewAction($permalink) |
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 |
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
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
# 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
<?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
<?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; |