TheSkullKid
Active member
I tried to extend the XF\Pub\Controller\Post and XF\Service\Post\Editor, in the second extended class I add a function called checkContent, but when I run the code the content $editor is not the expected one:
From the main / parent class this code line
returns
and I got the following error message:
Error: Call to undefined method DBTech\Credits\XF\Service\Post\Editor::checkContent() in src\addons\TSK\newTest\XF\Pub\Controller\Post.php at line 11
Why do I get back this and not XF\Service\Post\Editor?
What kind of stuff will be used in a wrong format?
PHP:
<?php
namespace TSK\newTest\XF\Pub\Controller;
use XF\Mvc\ParameterBag;
class Post extends XFCP_Post
{
protected function setupPostEdit(\XF\Entity\Post $post)
{
$editor = parent::setupPostEdit($post);
$editor->checkContent($this->filter('tsk_search', 'str'));
return $editor;
}
}
From the main / parent class this code line
PHP:
$editor = $this->service('XF:Post\Editor', $post);
returns
and I got the following error message:
Error: Call to undefined method DBTech\Credits\XF\Service\Post\Editor::checkContent() in src\addons\TSK\newTest\XF\Pub\Controller\Post.php at line 11
Why do I get back this and not XF\Service\Post\Editor?
What kind of stuff will be used in a wrong format?