V
V
Vlad Gromov2020-04-14 00:36:37
PHP
Vlad Gromov, 2020-04-14 00:36:37

I can not connect the class through Composer. Maybe I'm doing something wrong?

When connecting the class, it gives the following error:
Fatal error: Uncaught Error: Class 'application\controllers\FrontController' not found in D:\OpenServer\OSPanel\domains\forumedia\public\index.php on line 8

the connection comes from a file

<?php

use application\controllers\FrontController;

const INDEX_PAGE = 'title.php';

/* Инициализация и запуск FrontController */
$front = FrontController::getInstance();
$front->route();

/* Вывод данных */
echo $front->getBody();


Project link:
https://yadi.sk/d/_yNG0DeZRhdmbA

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksim Fedorov, 2020-04-14
@Vikkiners

1. in composer.json file:
"application\\": "application",
replace with "application\\": "application/",
2. Include in your autoload.php file:
require __DIR__.'/../vendor/autoload.php';
3. run composer commanddump-autoload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question