How to bundle external_form in a package
Permalink
Title says it all :) I'm building a custom package but I can't, for the life of me, figure out how to bundle a custom external form. My package name is "newsletter_registration" so the paths are:
and
My external form controller looks like this:
newsletter_registration/blocks/external_form/form/controller/newsletter_registration.php
and
newsletter_registration/blocks/external_form/form/newsletter_registration.php
My external form controller looks like this:
<?php namespace Concrete\Block\ExternalForm\Form\Controller; use Concrete\Core\Controller\AbstractController; class NewsletterRegistration extends AbstractController { public function action_register($bID = false) { if ($this->bID == $bID) { $this->set('response', t('Thanks!')); return true; } } public function view() { $this->set('message', t('This is just an example of how a custom form works.'));
Viewing 15 lines of 17 lines. View entire code block.
I thought it was the namespace too, but I did what you suggested before and that didn't work. I'll give it a try again and see if I had a typo or something...thanks.
Actually it looks like this is a core bug, you can't put External Forms into a package -http://www.concrete5.org/developers/bugs/5-7-5-3/external-form-in-p... so you might just have to put this in your application directory instead.
namespace Concrete\Package\NewsletterRegistration\Blocks\ExternalForm\Form\Controller;