I am using http://container.thephpleague.com as my Dependency Injection Container. I am making project in MVC and I am trying to not break MVC pattern.
I am loading Database, Json, etc. classes from DI Container (defined before routing, etc.), but I need models for every controller. Is this right way how to load Models with their own dependencies inside Controller?
Controller:
abstract class Controller
{
    protected $di;
    protected $db;
    protected $latte;
    protected $json;
    //etc...
    public function __construct(League\Container\Container $container)
    {
        $this->di = $container;
        $this->db = $container->get('database');
        $this->json = $container->get('json');
        //etc...
        $this->setup();
    }
}
class ApiController extends Controller
{
    function setup()
    {
        $this->model = new ApiModel($this->di);
    }
    public function showGames()
    {
        $this->latte->render("random-view.latte", $this->model-getGames());
    }
}
Model:
class Model
{
    protected $db;
    protected $json;
    public function __construct(League\Container\Container $container)
    {
        $this->json = $container->get('json');
        $this->db = $container->get('database');
    }
}
class ApiModel extends Model
{
    /**
     * Get games
     * @return mixed
     */
    public function getGames()
    {
        //db queries etc...
    }
}
Something saying me, that this is not right way.