i would like to send a message via FOSMessageBundle so i create a controller witch contain a method named send, after that i got an error in this instuction :
$sender = $this->get('fos_message.sender');
$sender->send($message);
the error message is :
Catchable Fatal Error: Argument 1 passed to FOS\MessageBundle\Sender\Sender::send() must implement interface FOS\MessageBundle\Model\MessageInterface, instance of FOS\MessageBundle\MessageBuilder\NewThreadMessageBuilder given, called in /projet/pivotalpartnersbo/src/Application/Sonata/MessageBundle/Controller/MessageController.php on line 32
The message must me created.
Something like $message = $builder->newThread();
or $message = $builder->reply($thread);
While you apparently have just $message = $builder;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.