This file contains 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 Dpanel\Bundle\AdminBundle\Forms; | |
use Cwd\GenericBundle\Doctrine\EntityRepository; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
This file contains 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
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { | |
protected function _initNavigation() { | |
// make sure the layout is loaded | |
$this->bootstrap('layout'); | |
// get the view of the layout | |
$layout = $this->getResource('layout'); | |
$view = $layout->getView(); | |
This file contains 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 Oneup\CommunityBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
// [...] other namespace stuff | |
/** |
This file contains 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
sonata_admin: | |
access_control: | |
- { path: ^/admin/sonata/media/media/list$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_LIST], methods: null } | |
- { path: ^/admin/sonata/media/media/create$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_CREATE], methods: null } | |
- { path: ^/admin/sonata/media/media/update$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_UPDATE], methods: null } | |
- { path: ^/admin/sonata/media/media/batch$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_BATCH], methods: null } | |
- { path: ^/admin/sonata/media/media/(?P[^/]+?)/edit$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_EDIT], methods: null } | |
- { path: ^/admin/sonata/media/media/(?P[^/]+?)/delete$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_DELETE], methods: null } | |
- { path: ^/admin/sonata/media/media/(?P[^/]+?)/view$, roles: [ROLE_SONATA_MEDIA_ADMIN_MEDIA_VIEW], methods: null } | |
- { path: ^/admin/sonata/media/gallery/list$, roles: [ROLE_SONATA_MEDIA_ADMIN_GALLERY_LIST], methods: null } |
This file contains 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 Majax\PortalBundle\Builder; | |
use Symfony\Bundle\DoctrineBundle\Registry; | |
class SiteListBuilder { | |
/** @var \Symfony\Bundle\DoctrineBundle\Registry */ | |
private $orm; | |
public function __construct($orm) |
This file contains 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
class I18nGenerator < Rails::Generators::NamedBase | |
def create_files | |
I18n.available_locales.each do |locale| | |
create_locale_file( locale ) | |
end | |
end | |
private | |
def namespaces |
This file contains 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 | |
// Itterate over the collection and grap the elements | |
foreach($form->get('collectionName')->getIterator() as $fieldset) | |
{ | |
echo $this->formRow($fieldset->get('elementName')); | |
echo $this->formRow($fieldset->get('elementAnotherElementName')); |
This file contains 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 | |
function splat(array ...$args) { | |
foreach ($args as $arg) { | |
print_r($arg); | |
} | |
} | |
splat(['firstArray'], ['secondArray']); | |
// Output: Array( [0] => firstArray ) Array( [0] => secondArray ) |
This file contains 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
# services to handle doctrine extensions | |
# import it in config.yml | |
services: | |
# KernelRequest listener | |
# extension.listener: | |
# class: AppBundle\Listener\DoctrineExtensionListener | |
# calls: | |
# - [ setContainer, [ @service_container ] ] | |
# tags: | |
# # translatable sets locale after router processing |
This file contains 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 AppBundle\Tests; | |
use SimpleBus\Message\Bus\MessageBus; | |
use SimpleBus\Message\Recorder\PublicMessageRecorder; | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; |
OlderNewer