1

I'm new to Magento 2 and I'm trying to create a module that uses Zend Json Server.

The initial code in the module controller was (in Magento 1):

public function postAction()
{
$server = new Zend_Json_Server();
    $client = new MyClientClass();
    $server->setClass($client);
    $server->handle();
}

How do I replace it in Magento 2? Thanks

1

After trying so many times I figured it out and thought to share.

$server = new \Zend\Json\Server\Server();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.