We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

zingcharts

Does anyone have any experience with Zingcharts using Phalcon and MVC? Not certain about the best way to pass the json from the controller to the view. cheers.

Simply make a json string such as and set as variable.

CONTROLLER:

<?php

use Phalcon\Mvc\Controller;

class IndexController extends Controller
{

    public function indexAction()
    {

        $myArray = array('setting' => array('height' => 100 ... ) ... );
        $this->view->setVar('json',json_encode($myArray));

    }
}

VIEW:


<?php echo $json; ?>