Results 1 to 3 of 3

Thread: Extension creation with a customized class

  1. #1
    User
    Join Date
    01-25-10.
    Location
    France
    Posts
    61

    Default Extension creation with a customized class

    Hello all,

    I need some help or information ...

    I used to use the loadFormField hook with a customized class (MonExtHooks) which was created with the extension creator tools in the back end.
    The mechanic woks with previous contao version,but with the lastest , i got problems.

    i put $GLOBALS['TL_HOOKS']['loadFormField'][] = array('MonExtHooks', 'loadFormField'); in the config.php of the MonExtHooks class
    in the MonExtHooks.php i wrote the two following simple functions :
    public function __construct()
    {
    //parent::__construct(); if no comment, an error occurs : Warning: Missing argument 1 for Contao\Module::__construct()
    //and Fatal error: Call to a member function row() on a non-object in .....\system\modules\core\modules\Module.php on line 80
    $this->import('BackendUser', 'User');
    }

    public function loadFormField(Widget $objWidget, $strForm, $arrForm ) {
    $objWidget->class = 'MonExtHooks';
    // doing something
    // ......
    return $objWidget;
    }

    but when i call the page where the form is, a lot accents appears (french language) and it seems that the interclassment has changed... (but it works without the extension creation )
    I have the message : Warning: Cannot modify header information - headers already sent by ....\system\helper\functions.php:70
    and finaly the return page is lost .. blank page nothing else in my application

    Thank you for helping
    regards
    Sharing and growing

  2. #2
    User
    Join Date
    01-25-10.
    Location
    France
    Posts
    61

    Default other issues about the loadFormField in a customized class

    hello,
    about my little but blocking problem
    when the form has only only field, all is fine (so only one passage through the loadFormField method)
    but thats not work with two and more (several passages through the loadFormField method)
    and a warning : " Cannot modify header information - headers already sent by
    ..."

    someone has an idea, please
    regards
    Last edited by thdelerme; 04/27/2014 at 13:23.
    Sharing and growing

  3. #3
    User
    Join Date
    01-25-10.
    Location
    France
    Posts
    61

    Default further explorations

    hello...
    i use now the 2.11 contao version for my stuff (instead of version 3).
    with the developper extension.
    Now my customized class works.

    Perhaps an error or bad parameters in developper tools of the version 3 instead of the developper extension in version 2.
    for instance there is not any use of page template in developper extension but needed in developper tools .
    (i have tried with a empty template, but no effect)

    to be continued ... or not ...
    regards
    Last edited by thdelerme; 05/04/2014 at 16:47.
    Sharing and growing

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •