Marcus
Well-known member
1. In XenForos code you always access the model from a controller through a $abcModel = getModelFromCache() function. Is it to display which models are accessed by the controller in the function list?
2. There are always {} embracing statements, even if there is just one single one.
3. Some addons use Name_XenForo_ControllerPublic_Thread, some use Name_ControllerPublic_Thread and some even use CoderName_Name_ControllerPublic_Thread. I got an addon from xfrocks and he used the first option, and I see its value at the former lacking of using hints for extending:
I'd like to hear about what you do and if you like to do so you could give some arguments for and against it.
2. There are always {} embracing statements, even if there is just one single one.
3. Some addons use Name_XenForo_ControllerPublic_Thread, some use Name_ControllerPublic_Thread and some even use CoderName_Name_ControllerPublic_Thread. I got an addon from xfrocks and he used the first option, and I see its value at the former lacking of using hints for extending:
PHP:
public static function load_class($class, array &$extend)
{
static $classes = array(
'XenForo_BbCode_Formatter_Base',
'XenForo_ControllerPublic_Thread',
'XenForo_DataWriter_DiscussionMessage_Post',
'XenForo_Model_Post',
'XenForo_ViewPublic_Thread_View',
'XenForo_ViewPublic_Thread_ViewPosts',
);
if (in_array($class, $classes))
{
$extend[] = 'PostCache_' . $class;
}
}
I'd like to hear about what you do and if you like to do so you could give some arguments for and against it.