cakephp3において
componentフォルダに色々と○○Component.phpを置いているのですが、
componentをそれぞれ機能ごとに整理したくその配下に新たにフォルダを置いてその中に使用するcomponentを置きたいです。
たとえば
Component
→logic
→□□Component.php
→common
→△△Component.php
この場合にController側でそれぞれを呼び出したいと思った際にどのような記述でフォルダごとに呼び出せるようにしないといけないのでしょうか。
Controllerで宣言すると
以下のようにComponent配下の指定したいComponent.phpを呼び出せてないっとエラーが発生してしまいます。
TestComponent could not be found. Error: Create the class TestComponent below in file: src/Controller/Component/TestComponent.php <?php namespace App\Controller\Component; use Cake\Controller\Component; class TestComponent extends Component { }
使用している
php:5.6
cakephp3
です。
以上、ご教授いただければと思います。
あなたの回答
tips
プレビュー