A
A
ArtKravchen2021-08-22 11:44:20
PHP
ArtKravchen, 2021-08-22 11:44:20

Calling the model in the class constructor (Opencart), right?

In the course of working with opencart (v2). I have a question. Is it correct from an OOP point of view to call models in the class constructor. Example:

<?php
class ControllerAccountAccount extends Controller
{
    public function __construct($registry)
    {
        parent::__construct($registry);
        $this->load->model('account/account');
    }

    public function index()
    {
        
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question