Documentacion Faltante

edited January 2013 in General
Estoy creando un plugin pero en la documentacion no se como colocar otro campo a register.tpl o a register.php sin tocar el codigo fuente de estos dos archivos. por favor colocar ejemplos.


  • You can use these hooks in 'register.php' in your plugin:


    So in your plugin class look for this method:

    static function Load() { }

    And add the hook attachments of your choice, i.e.:

    Plugin::Attach ( 'register.before_create' , array( __CLASS__ , 'add_my_custom_field' ) );

    so it would look similar to this:

    static function Load() {
    Plugin::Attach ( 'register.start' , array( __CLASS__ , 'add_my_custom_field' ) );
    Plugin::Attach ( 'register.before_create' , array( __CLASS__ , 'doSomething' ) );
    Plugin::Attach ( 'register.create' , array( __CLASS__ , 'doSomethingAgain' ) );

    You can attach to as many hooks as you want. Keep in mind that there must be a function in your plugin with the name you provided, i.e.:

    function add_my_custom_field() {}
    function doSomething() {}
    function doSomethingAgain() {}

    Additionally, you can provide a custom register.tpl in your plugin. Since that is a theme file that can be customized, it's okay to modify it's code. Just be just to provide instructions to your users on how to overwrite the current register.tpl

    Hope this helps!
This discussion has been closed.