Php Namespace Class Not Found

[Solved] Php Namespace Class Not Found | Php - Code Explorer | yomemimo.com
Question : php namespace class not found

Answered by : ruthvik

<?php
include('controller.php');
use \Some\Path\To\Controller;
// Desired class is in namespace!
$controller = new Controller\Controller();
// In controller.php
namespace Some\Path\To\Controller;
class Controller
{ function __construct(){}	function index(){}
}

Source : | Last Update : Sat, 23 Jul 22

Answers related to php namespace class not found

Code Explorer Popular Question For Php