1

SonataAdminバンドルを構成しましたが、admin / Dashboardをロードしようとすると、ランダムなメモリの問題が発生します。

これがSonataCRUDを含む私の2つのエンティティです:

namespace Jade\ReveBundle\Admin;

use Doctrine\Common\Collections\Collection;

use Jade\ReveBundle\Entity\Thematique;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;

class ProduitAdmin extends Admin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('titre')
            ->add('description')
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('titre')
            ->add('description')
        ;
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('id')
            ->add('titre')
            ->add('description')
        ;
    }

    public function validate(ErrorElement $errorElement, $object)
    {
        $errorElement
            ->with('titre')
                ->assertMaxLength(array('limit' => 32))
            ->end()
        ;
    }
}


namespace Jade\ReveBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;

class ThematiqueAdmin extends Admin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('titre')
            ->add('description')
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('titre')
            ->add('description')
        ;
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('id')
            ->add('titre')
            ->add('description')
        ;
    }

    public function validate(ErrorElement $errorElement, $object)
    {
        $errorElement
            ->with('titre')
                ->assertMaxLength(array('limit' => 32))
            ->end()
        ;
    }
}

私が問題のアイデアを持っている人はいますか?あなたの答えのためのThx

4

1 に答える 1

-1

エラーが「PHP 致命的エラー: xxxx バイトの許容メモリ サイズを使い果たしました...」の場合は、PHP メモリ制限を増やしてみてください。Sonata は Doctrine ORM を使用しており、エンティティは大量のメモリを消費する可能性があります。dev モードのプロファイラーにも多くの情報がメモリに保存されます。

ファイル web/app_dev.php および web/app.php:

<?php 
ini_set('memory_limit','128M'); //or some other reasonable value
...

またはphp.iniで:

memory_limit = 128M
于 2012-10-07T17:00:13.807 に答える