Jump to content

"Only subclasses of Dispatcher can be instantiated" Error


Go to solution Solved by Daniel F,

Recommended Posts

Posted

Hello,

When I run this line: ($tab has the value of 'comments')

$record->commentReviews( $tab );

I get the following error:

Quote

Only subclasses of Dispatcher can be instantiated

My guess is it throws the error when it hits this line in Records.php:

return \IPS\cms\Theme::i()->getTemplate( static::database()->template_display, 'cms', 'database' )->comments( $this );

Can't figure out why this is happening though. Am I missing a step? I do run init.php already beforehand.

Posted
22 minutes ago, Daniel F said:

It’s not enough to include the init.php , you also need to initialize the dispatcher . 

What's the way to do that?

Like so?

\IPS\Dispatcher\Front::i()->run()

 

  • Recently Browsing   0 members

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