XF 2.1 Convert from 1.X to 2.X plugin

sajal

Active member
We're moving to XF 2.1 from XF 1.5.21, and we've developed a couple of custom plugins, we'll have to convert it to 2.x!

During development, I can see that, I can still use the code like following:

$options = \XenForo_Application::get('options');
$db = \XenForo_Application::getDb();
$language = \XenForo_Visitor::getInstance()->getLanguage();
$ut_content_datetime=\XenForo_Locale::getFormattedDate($post['post_date'], 'Y-m-d\TH:i:s\Z', $language, 'UTC');

Is it OK to use this? Or we should strictly avoid this and try to find alternatives as per XF2 standards?

Is there any guide that can be specifically useful to convert existing 1.5 plugins to XF 2?

Thanks in advance.
 
$visitor = \XF::visitor();

$options = \XF::options();
$group = $options->mySelectedGroup;

$db = \XF::db();

XF2 is actually a lot simpler to create add-ons for, than XF1. To get started check out this tutorial, and be sure to follow these standards.
 
Top Bottom