Postanowiłem zrobić sobie taki autoloader do klas, poszperałem w Google i najlepszym rozwiązaniem wydało mi się użycie przestrzeni nazw.
Jednak tutaj napotkałem problem
Mam plik1.php który definiuje przestrzeń nazw nast.:
<?php namespace framework\actionResolving\ActionResolvingStrategyInterface; interface ActionResolvingStrategyInterface { ... }
Oraz plik2.php
<?php namespace framework\actionResolving\ActionResolvingByFile; require_once 'ActionResolvingStrategyInterface.php'; use framework\actionResolving\ActionResolvingStrategyInterface; class ActionResolvingByFile implements ActionResolvingStrategyInterface { ... }
i wyrzuca mi błąd, który mówi, że nie może odnajść interfejsu
Kod
Fatal error: Interface 'framework\actionResolving\ActionResolvingStrategyInterface' not found in D:\xamp\htdocs\ftest\framework\actionResolving\plik2.php on line 8
Przeglądnąłem cały manual, i nie znalazłem odpowiedzi. Dlaczego nie mogę odnaleźć intefejsu. Pozdrawiam,