We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Error with edit_template_start extension hook

Development and Programming

Brett DeWoody's avatar
Brett DeWoody
140 posts
14 years ago
Brett DeWoody's avatar Brett DeWoody

I’m creating an extension that uses the edit_template_start hook. When I open a new template I’m getting the following error:

A PHP Error was encountered
Severity: Warning
Message: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Eehive_boilerplate_ext::boilerplate_template' was given
Filename: libraries/Extensions.php
Line Number: 261

The important code is below:

public function activate_extension()
    {
        // Setup custom settings in this array.
        $this->settings = array();
        
        $data = array(
            'class'        => __CLASS__,
            'method'    => 'boilerplate_template',
            'hook'        => 'edit_template_start',
            'settings'    => serialize($this->settings),
            'version'    => $this->version,
            'enabled'    => 'y'
        );

        $this->EE->db->insert('extensions', $data);            
        
    }    

    // ----------------------------------------------------------------------
    
    /**
     * boilerplate_template
     *
     * @param 
     * @return 
     */
    function boilerplate_template($query, $template_id, $message) {
        
        
        
    }

Am I not using the hook correctly? Any help is appreciated. Thanks!

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
14 years ago
Brett DeWoody's avatar Brett DeWoody

Turns out I was editing the wrong file. Resolved!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.