dotnetic Posted April 6, 2021 Share Posted April 6, 2021 I added this example code taken from ProcessWire 3.0.173 core updates: New URL hooks to my site/_init.php // _init.php wire()->addHook('/hello/world', function($event) { return 'Hello World'; }); and get the following error: So what is wrong? As I am in the _init.php the hook should be attached during init, right? Link to comment Share on other sites More sharing options...
bernhard Posted April 6, 2021 Share Posted April 6, 2021 No ? _init.php is the file that you PREpend to the template rendering (just like _main.php is APpended). /site/init.php and /site/ready.php are something different and the place where you want to attach your hook. 4 Link to comment Share on other sites More sharing options...
dotnetic Posted April 6, 2021 Author Share Posted April 6, 2021 Thanks @bernhard. Problem solved Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now