I'm writing a new class that integrates into the HOOK below. I'm getting a class loading error, so I'm assuming I'm doing something really silly wrong. It seems that the PHP function get_class_methods($strClass) is called and a NULL result is obtained. Also, I'm getting a "Cannot redeclare class", but I'm assuming this might be the error above first.
This all worked perfectly in 2.x, so this must be a 3.x thing. Anyone with ideas?
config/config.php
Code:
$GLOBALS['TL_HOOKS']['getUserNavigation'][] = array('Favorites', 'getFavorites');
classes/Favorites.php
Code:
/**
* Run in a custom namespace, so the class can be replaced
*/
namespace Contao;
/**
* Class Favorites
*
* Adds Favorite system to Contao
* @copyright Thyon Design 2013
* @author John Brand <http://www.thyon.com>
* @package Controller
*/
class Favorites extends \Backend
{
…
Code:
Warning: in_array() expects parameter 2 to be array, null given in /home/onlinbuy/public_html/system/modules/core/library/Contao/System.php on line 110
#0 [internal function]: __error(2, 'in_array() expe...', '/home/onlinbuy/...', 110, Array)
#1 /home/onlinbuy/public_html/system/modules/core/library/Contao/System.php(110): in_array('getInstance', NULL)
#2 /home/onlinbuy/public_html/system/modules/core/classes/BackendUser.php(475): Contao\System->import('Favorites')
#3 /home/onlinbuy/public_html/contao/main.php(275): Contao\BackendUser->navigation()
#4 /home/onlinbuy/public_html/contao/main.php(125): Main->output()
#5 /home/onlinbuy/public_html/contao/main.php(319): Main->run()
#6 {main}
Fatal error: Cannot redeclare class Contao\Favorites in /home/onlinbuy/public_html/system/modules/favorites/classes/Favorites.php on line 585
Bookmarks