This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Contact Form
expandshrink

Contact Form

Contact Form

Thursday 30 January 2014 2:17:11 pm - 11 replies

Hi!

Is it possible with EZ5 to manage collectors informations attributes to create a contact form?

Or is there a another way to create a contact form?

Thank you !

Alizée

Thursday 30 January 2014 2:35:11 pm

Hi there. i think there is "ported version" of the legacy collectors informations yet, but ez crew could confirm that.

Anyway, if you need a basic form without the need of recollection that information like legacy did, that task is extremely easy with symfony and imho really more flexible than the ez legacy way. It needs a bit of code though

There are some tutorials over there like this one

http://www.lucas.courot.com/how-to-create-a-contact-form-using-symfony2.html.

Also have a look to the official symfony doc related to form:

http://symfony.com/doc/current/book/forms.html

If you still need the recollection functionality would it would say for now (even probably is not the best way its)

Never tested though, just a first thought. Good be good to read another opinions.

Edit: I'm migrating a legacy site to symfony stack these days. hope to finish in the next hours and yep, i also added a contact form (but without the recollection legacy stuff). If you also need a captcha for your form have a look at https://github.com/genemu/GenemuFormBundle

Modified on Thursday 30 January 2014 3:16:01 pm by Carlos Revillo

Friday 31 January 2014 3:34:01 pm

Hi,

Thank you for your reply! But in my controller I have this error:

emergency.EMERGENCY: Call to undefined method xxx\BaseBundle\Controller\xxxController::createForm() {"type":1,"file":"/var/www/appezxxxxxx.com/htdocs/src/xxx/xxx/Controller/xxxController.php","line":64} []

 Is it that I forgot a "use"?

My function:

 public function contactAction(Request $request) {  

 $form = $this->createForm(new ContactType());

 if ($request->isMethod('POST')) {

$form->bind($request);

[...]

 

Tkanks ! Alizée

Modified on Friday 31 January 2014 3:34:43 pm by Alizée Arnaud

Monday 03 February 2014 9:49:27 am

Hi Alizée

It seems that your controller doesn't inherit from the right base controller. It should be a child class of eZ\Bundle\EzPublishCoreBundle\Controller.

Tuesday 04 February 2014 9:53:41 am

Hi Jérôme!

You're right I didn't use the correct controller...

But now I've a problem, I've two controllers, one for my base controller and I've to create another one to manage my contact form ...

The first one: use eZ \ Publish \ Core \ MVC \ Symfony \ Controller \ Controller; (Thiago Campos Viana) 

And the second one: eZ \ Bundle \ EzPublishCoreBundle \ Controller; 

Should I use a single controller or can I use more? How to manage them in component.php ?

 

Tkank you !

Alizée

Tuesday 04 February 2014 9:58:42 am

Hi Alizée

You should always use the base controller from EzPublishCoreBundle as it will give you access to helper methods (like createForm) . The other one you mention is for internal use.

Tuesday 04 February 2014 10:04:26 am

What you mean about internal use ? 

Why Thiago Campos Viana use it ? 

Thanks !

Tuesday 04 February 2014 10:25:14 am

I mean for internal controllers in the kernel. Of course you can use it, but you may be a bit "limited". Thiago probably uses it by mistake blunk.gif Emoticon

Tuesday 04 February 2014 10:48:39 am

It's so critic for me!
Can i extend this controller into the classes who use it ?

Tuesday 04 February 2014 10:51:43 am

Of course you can! It's made for it happy.gif Emoticon

Tuesday 04 February 2014 10:55:59 am

Sorry but can you explain me how can i do that ? ^^ 

Tuesday 04 February 2014 12:05:32 pm

Problem solved ! My contact form finally work.

Tkank you very much for your patience !

Alizée

Modified on Wednesday 05 February 2014 3:14:13 pm by Alizée Arnaud

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from