Hi people.
I am with a problem that i would like to show the images of a user outside
an admin page.
I have a view like this
<div id="timeline" class="col-sm-9" style="height: 56em; background-color:
#ffffff">
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}
</div>
A controller like this
$form = $this->createForm(GaleriaForm::class, null);
return $this->render('hold/perfil/index.html.twig', array('objetoUsuario'
=> $usuario, 'form' => $form) );
And An admin like this
<?php
namespace AppBundle\Form;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class GaleriaForm extends Admin
{
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
// ... others fields here
->add('media', 'sonata_media_type', array(
'provider' => 'sonata.media.provider.image',
'context' => 'default'
));
;
}
protected function configureDatagridFilters(DatagridMapper
$datagridMapper)
{
$datagridMapper->add('media');
}
protected function configureListFields(ListMapper $listMapper)
{
$listMapper->addIdentifier('media');
}
}
But the server crashes when i try to access the view of this user.
Can anyone help me with this problem?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"sonata-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sonata-users.
For more options, visit https://groups.google.com/d/optout.