symfony-sonata

Issue with sonataIntlBundle - I can`t install with composer

风流意气都作罢 提交于 2019-12-11 06:09:11
问题 Output from composer (after composer.phar update) Problem 1 - Installation request for sonata-project/intl-bundle 2.2.*@dev -> satisfiable by sonata-project/intl-bundle[2.2.x-dev]. - sonata-project/intl-bundle 2.2.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system. Problem 2 - sonata-project/intl-bundle 2.2.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system. - symfony/framework-standard-edition 2.3.x-dev requires

SonataMediaBundle: The file “” does not exist 500 Internal Server Error - FileNotFoundException

。_饼干妹妹 提交于 2019-12-11 03:08:13
问题 I uploaded some files using the SonataMediaBundle but when i wanted to add another, i got that error. Have you any idea ? this is the stack error: in /var/www/znata.com/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php at line 107 -+ public function guess($path) { if (!is_file($path)) { throw new FileNotFoundException($path); } if (!is_readable($path)) { Thanks 回答1: Probably caused because your php.ini settings has a max uploaded size set. Change

How to define/pass the entity manager for sonata-admin

萝らか妹 提交于 2019-12-11 01:39:21
问题 I followed this tutorial to install SonataAdmin with FOSUserBundle. Now i keep getting this Error Message: No entity manager defined for class Application\Sonata\UserBundle\Entity\User But how do i set/pass the EntityManager? I haven't found anything about configuring it or any hint on what this error means. Any help anyone? Edit #1: As asked for, here is what i have in my config.yml for sonata so far: sonata_block: default_contexts: [cms] blocks: sonata.admin.block.admin_list: contexts:

How to extends Sonata\DoctrineORMAdminBundle\Model\ModelManager

陌路散爱 提交于 2019-12-10 10:37:41
问题 I want some changes in ModelMangaer then I was extending ModelManager but It's not working. I don't know why ? Any one tell me why it is not working? File where I extend Sonata\DoctrineORMAdminBundle\Model\ModelManager-> <?php use Sonata\DoctrineORMAdminBundle\Model\ModelManager; class ModelManager extends ModelManager { /** * {@inheritdoc} */ public function getSortParameters(FieldDescriptionInterface $fieldDescription, DatagridInterface $datagrid) { $values = $datagrid->getValues(); $values

Adding a custom form inside the show template of a Sonata Admin Entity

99封情书 提交于 2019-12-10 03:26:10
问题 I want to generate a small form inside a Sonata Admin show template. What I have done so far is creating the function in the custom CRUD for that specific entity (order) that extends from Sonata's default CRUD; public function approveOrderAction($id = null) { $request = $this->getRequest(); $id = $request->get($this->admin->getIdParameter()); $order = $this->admin->getObject($id); $approveForm = $this->createFormBuilder($order) ->add('reqSecondApprover', 'checkbox', array('label' => 'Require

Symfony SonataAdmin Templates

元气小坏坏 提交于 2019-12-09 23:34:02
问题 I am trying to modify the SonataAdmin templates. I have an Image entity that has a path property. I created an ImageAdmin class and this is integrated into sonataAdmin. I would like to modify the admin-list-view to wrap the path in an img tag so that the image is actually displayed. Does anyone know how I can do this? Thanks! 回答1: There are 2 ways to use your own templates. In the config file: sonata_doctrine_orm_admin: entity_manager: templates: form: - SonataDoctrineORMAdminBundle:Form:form

Custom Home page sonata page

隐身守侯 提交于 2019-12-08 09:50:16
问题 I create my custom controller for the page home. controller: class FrontPageController extends Controller { public function homeAction() { return $this->render('FrontPageBundle:Page:home.html.twig'); } } routing.yml front_page_home: path: / defaults: { _controller: FrontPageBundle:FrontPage:home } but the url to my controller redirects to the controller sonata.page.page_service_manager:execute route: "page_slug" 回答1: I found a solution but I don't know if it is good practice or not. I create

SonataDoctrineORM - Model extends

本小妞迷上赌 提交于 2019-12-08 08:15:00
问题 I'm using Sonata with SonataAdmin & SonataOrm as told in several tutorials. I simply would like to remove some default method of DoctrineOrmBundle- ModelManager.php I tried to override the ModelManager by putting <?php namespace Project\AdminBundle\Model; use Sonata\DoctrineORMAdminBundle\Model\ModelManager as ModelManager; class ModelManager extends ModelManager { /** * {@inheritdoc} */ public function getSortParameters(FieldDescriptionInterface $fieldDescription, DatagridInterface $datagrid

Sonata Admin - No Header

て烟熏妆下的殇ゞ 提交于 2019-12-08 07:42:37
问题 I extends "SonataAdminBundle::standard_layout.html.twig and it show me admin theme without header/menu. After the debug code "admin_pool" is not defined I passed from admin_pool from the controller but still not defined. Can you please tell me what am I missing? 回答1: I solved header's problem myself using below code $admin_pool = $this->get('sonata.admin.pool'); return $this->render('ProjectBundle:Controller:page.html.twig', array('admin_pool' => $admin_pool)); 来源: https://stackoverflow.com

SonataAdminBundle Security roles

三世轮回 提交于 2019-12-08 07:21:28
问题 I'm trying to secure some admin in SonataAdminBundle I add SonataUserBundle with fosUserBundle for login. So I can add users, groups and roles in security.yml role_hierarchy: ROLE_ADMIN: ROLE_ADMIN ROLE_IT: ROLE_IT ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_IT] access_control: - { path: ^/sonata/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata/login-check$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata, role: