Menu

#127 Add a generic __constructor for PHP5 sub-classing

closed
None
5
2005-07-19
2005-06-22
No

When sub-classing in PHP4, you often need to call the superclass'
constructor. This requires that you use the name of the class, which
has a possibility of breaking. In PHP5, the __constructor function
was defined and is called by default. This patch adds a
__constructor function to the fckeditor class, permitting safe
incorporation into class libraries. It's safe for PHP4 as the old-style
constructor simply calls the new one, and the new constructor is still
valid PHP4 syntax.

So, when extending the FCKeditor class in PHP5, you can now say
this:

class foo extends FCKeditor {
function __construct($instancename) {
parent::__construct();
...
}

Discussion

  • Frederico Caldeira Knabben

    • status: open --> pending
     
  • Frederico Caldeira Knabben

    Logged In: YES
    user_id=572424

    Hello Marcus... Am I missing something, or you forgot to
    include the patch you your post?

     
  • Marcus Bointon

    Marcus Bointon - 2005-07-09

    Patch to apply to fckeditor.php

     
  • Marcus Bointon

    Marcus Bointon - 2005-07-09
    • status: pending --> open
     
  • Marcus Bointon

    Marcus Bointon - 2005-07-09

    Logged In: YES
    user_id=602594

    Hum. I thought I had attached it. Oh well, here it is now. If it's of any
    consequence, I'd be far happier if you fixed the mixed line break formats in
    the source files (see bug reports) before worrying about this patch!

     
  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
     
  • Frederico Caldeira Knabben

    Logged In: YES
    user_id=572424

    This patch has been included in the last version.

     
  • Frederico Caldeira Knabben

    • status: open --> closed
     
  • Nobody/Anonymous

    Logged In: NO

    Is there a way to increase the size of the textarea?

     
  • Nobody/Anonymous

    Logged In: NO

    um... can someone please post an example in using this
    please? thanks so much

    Terry R
    remsikt@gmail.com

     

Log in to post a comment.

MongoDB Logo MongoDB