Jump to content

Recommended Posts

Posted

@tiefenbacher_bluetomato

You can us the following hook to extend the smarty object:

wire()->addHookAfter('TemplateEngineSmarty::initSmarty', function (HookEvent $event) {
  $smarty = $event->arguments('smarty');
  // Register your function here
});

 

  • Like 1
  • 2 months later...
  • 1 year later...
Posted

Hi @markus_blue_tomato ! Just wanted to ask you, I'm trying to throw a 404 on a controller to invalidate some urls but I am getting stuck on getting a 500 error because the exception doesn't get caught, just wondering if you had any experience tackling something like this.

Doing this at the end of the controller:

if($input->urlSegment1) {
   $pageOnSegment = getPageToRender(); 
   $view->set('page', $page);
} else{
   throw new Wire404Exception();
}

 

Posted
22 hours ago, elabx said:

Hi @markus_blue_tomato ! Just wanted to ask you, I'm trying to throw a 404 on a controller to invalidate some urls but I am getting stuck on getting a 500 error because the exception doesn't get caught, just wondering if you had any experience tackling something like this.

Doing this at the end of the controller:


if($input->urlSegment1) {
   $pageOnSegment = getPageToRender(); 
   $view->set('page', $page);
} else{
   throw new Wire404Exception();
}

 

Hm, not yet... Maybe @Wanze has an idea?

Posted
1 minute ago, markus_blue_tomato said:

Hm, no yet... Maybe @Wanze has an idea?

Thanks!! I know @Wanze is now a bit disconnected of the ProcessWire world that's why I haven't tagged him but seems like my last hope ?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...