Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules  

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba


Reply

Available BB Code tags

  • Bold Text [b]Bold[/b]
  • Italic Text [i]Italic Text[/i]
  • Underlined Text [u]Underlined[/u]
  • Struck-out Text [s]Struck-out[/s]
  • Coloured text [color=blue]blue text[/color]
  • Alignment [align=right]right aligned[/align]
  • Code Block: Unformatted code block [code]Code block[/code]
  • Email link: Create link to an email address [email]you@yoursite.com[/email]
  • Email link: Create link to an email address [email=you@yoursite.com]Email[/email]
  • Unordered list: Unordered list [ulist][*]unordered item 1[/ulist]
  • Image: Show an image in your post [img]http://www.website.com/image.jpg[/img]
  • Website link: Link to another website or URL [url]http://www.website.com/[/url]
  • Website link: Link to another website or URL [url=http://www.website.com/]Website[/url]

Available BB Code tags

  • Bold Text
    Example: [b]Bold[/b]
  • Italic Text
    Example: [i]Italic Text[/i]
  • Underlined Text
    Example: [u]Underlined[/u]
  • Struck-out Text
    Example: [s]Struck-out[/s]
  • Coloured text
    Example: [color=blue]blue text[/color]
  • Alignment
    Example: [align=right]right aligned[/align]
  • Code Block: Unformatted code block
    Example: [code]Code block[/code]
  • Email link: Create link to an email address
    Example: [email]you@yoursite.com[/email]
  • Email link: Create link to an email address
    Example: [email=you@yoursite.com]Email[/email]
  • Unordered list: Unordered list
    Example: [ulist][*]unordered item 1[/ulist]
  • Image: Show an image in your post
    Example: [img]http://www.website.com/image.jpg[/img]
  • Website link: Link to another website or URL
    Example: [url]http://www.website.com/[/url]
  • Website link: Link to another website or URL
    Example: [url=http://www.website.com/]Website[/url]
Avatar
omnicurse

Community Member, 8 Posts

25 April 2014 at 5:55pm

Seems this is now more a blog than a request for assistants.

For anyone else; The reason the second solution is being ignored is I forgot to inject the subclass. In the config.yml simply adding

Injector:
  UserDefinedForm:
    class: TestConnector

Solved the issue. Pressing forwards.

Avatar
omnicurse

Community Member, 8 Posts

25 April 2014 at 5:35pm

After a bit of googling, seems an easier way is to subclass the Userform_Controller and override the process method.

If thats the case, why is this function ignored?

class TestConnector_Controller extends UserDefinedForm_Controller
{

    private static $allowed_actions = array(
        'process'
    );

    public function process($data, $form)
    {
        echo "TEST";
    }

}

Avatar
omnicurse

Community Member, 8 Posts

25 April 2014 at 4:01pm

Heya,

I'm working on a connector for the UserForms to send data to a third party service on submit. I'm just not sure how to get override/extend functions in PHP to make this possible.

Currently have a simple class

class ServiceConnector extends Extension
{

    public function onAfterInit()
    {
        echo "<h1>TEST!</h1>";
    }

}

and in a config.yml I've got

UserDefinedForm_Controller:
  extensions:
    - ServiceConnector 

This works in the sense that TEST! is showing up each time a page where a userform is displayed (Testing I've got the extension at least partially correct), but how do I go about getting the actual data json array?

I thought I would have been able to 'extend' the process method from the userform controller but if I try and do something like

class ServiceConnector extends Extension
{

    public function process($data, $form)
    {
        echo $this->owner->data
    }

}

I get nothing, so assuming its not calling my version of the method? Same can be said for any method I try and extend/modify.