admin-generator

Symfony alternate new action

人走茶凉 提交于 2020-01-05 07:34:48
问题 I have a server where I need to store some images. Now the images can be either uploaded or created on the fly let us say just by adding some text to some default picture(So I made a file MakenewForm.php for that) . The table in my database stores filename on the local filesystem. Now upload is simple, I can just use the default _new action for that. For creating picture, I made a new action, say makenew . new and makenew both are diplayed on the list view. I copied newSuccess.php to

Symfony submit to same url

倖福魔咒の 提交于 2019-12-12 04:17:11
问题 I have a form with some text fields and I have a preview button that needs to submit the form to the same controller. And then in the controller, I need to extract the values and populate a form with these values for the template to see. What is the best way to achieve this? I'm a newbe so please be clear. 回答1: Sample controller: public function myControllerName(sfWebRequest $request) { $this->form = new myFormClass(); } Use <?php echo $form->renderFormTag( url_for('@yourRoutingName'), array(

Raw filter on Sonata Admin Bundle configureShowFields

好久不见. 提交于 2019-12-08 05:15:03
问题 I'm doing a project with Symfony2 and Sonata Admin Bundle. How I can apply the filter raw of twig (to display formated text) in action configureShowFields? I would not override Sonata templates... The code of my configureShowFields: protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->add('active') ->add('title') ->add('subtitle') // I need this field with twig RAW filter ->add('description') //I need this field with twig RAW filter ->add('url') ->add('date') ->add(