#1 June 18, 2018 11:08am

tsamant
Member
From: Chicago
Registered: May 14, 2015
Posts: 52

Class not found in templates/basic/home.php

Summary: I am trying to set up a new module on a local server (apache on mac) and the code dies due to not finding class 'CAFHomeHero' (just an example).

I think I did everything right in admin: a module, a view and form, etc. The only glitch was that custom/inc/modules/home-hero.php was already created, so admin failed to create it. There is not much in that file:

<?
	class CAFHomeHero extends BigTreeModule {
		var $Table = "caf_home_hero";
	}
?>

The table exists.

After all this, refreshing a page still dies with a message like:

Class 'CAFHomeHero' not found in .../templates/basic/home.php

What am I missing?

Thanks,
Tushar

Offline

#2 June 18, 2018 11:38am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Class not found in templates/basic/home.php

Make sure /cache/bigtree-module-class-list.json is writable. If it is and it exists, verify that your CAFHomeHero class is in the list and that the value for the key is the same as your filename (without .php), so in this case I think that would be "home-hero".

Offline

#3 June 18, 2018 12:42pm

tsamant
Member
From: Chicago
Registered: May 14, 2015
Posts: 52

Re: Class not found in templates/basic/home.php

Tim, that did the trick, thanks! Learned something new today.

Tushar

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.