I try use JMSSerializerBundle I updated my composer, added bundle in my AppKernel.
And I writed this
namespace Surgery\PatientBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class VisitsController extends Controller{
public function testAction()
{
$arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
$serializer = $container->get('jms_serializer');
$serializer->serialize($arr, 'json');
And i get this
Call to a member function get() on a non-object
Any idea what I did wrong or I did’t ?
$container is not initialized. It’s a null. You need to get the container from