I'm pretty new to XF development...I'm working on an extension, and my controller extensions are working fine, but all my model extensions are resulting in a
There aren't classes with the same names as my model extension classes anywhere else, so I'm not sure what would be causing the problem. Here's my Listener.php file:
I've created code event listeners in the admin as well, which use
My model extension class declarations look like
Any thoughts on what's going on here? Thanks!
Cannot declare class XFCP_<class_name>, because the name is already in use
error.There aren't classes with the same names as my model extension classes anywhere else, so I'm not sure what would be causing the problem. Here's my Listener.php file:
PHP:
<?php
class AddOn_Listener
{
public static function loadClassController($class, array &$extend) {
if ($class == 'XenForo_ControllerPublic_Thread')
{
$extend[] = 'AddOn_ControllerPublic_Thread';
}
}
public static function loadClassModel($class, array &$extend) {
if ($class == 'XenForo_Model_Thread')
{
$extend[] = 'AddOn_Model_Thread';
}
else if ($class == 'XenForo_Model_Post')
{
$extend[] = 'AddOn_Model_Post';
}
}
}
I've created code event listeners in the admin as well, which use
loadClassModel]
for the model extensions and loadClassController]
for the class extension.My model extension class declarations look like
class AddOn_Model_Thread extends XFCP_AddOn_Model_Thread {...}
.Any thoughts on what's going on here? Thanks!