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:

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.'));

stephendmalloy
 
hutman replied on at Permalink Reply
hutman
Your namespace is wrong at the top, it should be

namespace Concrete\Package\NewsletterRegistration\Blocks\ExternalForm\Form\Controller;
stephendmalloy replied on at Permalink Reply
stephendmalloy
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.
hutman replied on at Permalink Reply
hutman
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.