V
V
Vladislav2020-07-24 12:22:58
Yii
Vladislav, 2020-07-24 12:22:58

How to connect your YII2 library to autoloader?

For example, I have my own php class:

<?php

namespace mylibs/name;

use Yii;

class Myclass
{
 // Реализация класса
}

I manually added it to the vendor along the path: /vendor/mylibs/name/Myclass.php

What needs to be done so that I can connect this class in the controller and work with it using the SiteController example.

use app mylibs\name\Myclass;
$cl = new Myclass();

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