1 (edited by virtual 2009-01-23 13:25:31)

Topic: hook_tag pointing to a class function

Hello. I have htmLawed as part of a class, you can see the pseudo code below:

class parse_output
    private congif
    private spec

    function constructor
        setup_htmlawed()
    end function

    function setup_htmlawed
        include htmlawed class
    end function

    function my_custom_hook
        // Logic here stripping out a few CSS nasties
    end function

    function parse (input)
        return htmlawed(input, this->config, this->spec)
    end function
end class

However, the custom hook I have defined in the config is never run - would I do something similar to how PHP natively handles this: array('this', 'function').

I'm rather stuck and confused. Please help!

Edit: I'm using htmLawed 1.1 (which I have modified slightly and cannot update to 1.2)

2

Re: hook_tag pointing to a class function

I guess you want to have the 'my_custom_hook' function declared inside the class and not outside. htmLawed does not see the function when it is declared inside. I don't have much expertise in OOP, and don't know how this can be achieved.

3

Re: hook_tag pointing to a class function

Thanks. I just had to declare it outside the class like you said :)