Hello! To create thread in 2.0v we use such a code:
$creator = \XF::service('XF:Thread\Creator', $forum);
$creator->setContent($title, $message);
$creator->setUser($user);
$creator->setPrefix($forum['default_prefix_id']);
$creator->setIsAutomated();
$creator->save();
Everything is fine. But how can I attach an image to this thread? I can't workaround this problem for a long time. Please help!
$creator = \XF::service('XF:Thread\Creator', $forum);
$creator->setContent($title, $message);
$creator->setUser($user);
$creator->setPrefix($forum['default_prefix_id']);
$creator->setIsAutomated();
$creator->save();
Everything is fine. But how can I attach an image to this thread? I can't workaround this problem for a long time. Please help!
Upvote
0