markus_blue_tomato Posted October 3, 2021 Share Posted October 3, 2021 I have tried to use following code in _init.php and _ready.php: wire()->addHook('/hello-world', function($event) { return 'Hello World'; }); But got this back when I visit /hello-world: Ouch… Error: Exception: Path hooks must be attached during init or ready states (in wire/core/WireHooks.php line 834) When I add the hook in init.php I get the 404 Page. Can anyone help me here? 1 Link to comment Share on other sites More sharing options...
markus_blue_tomato Posted October 3, 2021 Author Share Posted October 3, 2021 Ooooooh - fixed: First I thought site/templates/_init.php is the same as site/init.php and then had init.php in site/templates instead of site. ? 1 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