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

Are cp_css_end and cp_js_end available in 3.3.3

Development and Programming

seavers's avatar
seavers
10 posts
8 years ago
seavers's avatar seavers

Hi,

I’m writing an extension that uses both the cp_css_end and cp_js_end hooks as documented in:

https://docs.expressionengine.com/latest/development/extension_hooks/cp/javascript/index.html

They are not firing in Expressionengine 3.3.3. Are they available in that version? If not, what version are they available in?

Kind regards,

James

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

They work fine for me in 3.3.3. Have you looked in exp_extensions to make sure your extension is adding the right information to the database?

       
seavers's avatar
seavers
10 posts
8 years ago
seavers's avatar seavers

Thanks Pedro - I checked and it was added to exp_extensions.

It turns out it was firing. The issue was that I thought I could return a string of javascript code in the method that is called.

However, it looks as though the hook is designed to parse the contents of a file rather than parse a string directly from the method.

So, the following works for me now:

public function cp_js_end()
    {
        return file_get_contents( PATH_THIRD . '/sym_cloner/js/sym_cloner.js');
    }
       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

You should be able to do either, file_get_contents returns a string after all.

       
seavers's avatar
seavers
10 posts
8 years ago
seavers's avatar seavers

Ok, thanks Pedro, I’ll retry the string bit. Thanks for your help.

       

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.