質問 > フロント機能 > トップページに商品一覧を出したい |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
nic |
投稿日時: 2019/2/7 19:49
対応状況: −−−
|
半人前 登録日: 2017/4/17 居住地: 投稿: 17 |
Re: トップページに商品一覧を出したい 御教授ありがとうございます。
デバックモードで確認したところ、以下のような表示が出ました。 An exception has been thrown during the rendering of a template ("The autoloader expected class "Eccube\Controller\Block\Item_ListController" to be defined in file "/home/XXX/●●.com/public_html/shop/vendor/composer/../../src/Eccube/Controller/Block/Item_ListController.php". The file was found but the class was not in it, the class name or namespace probably has a typo."). ↑ おそらく、「ファイルとの紐づけはされてるけど、クラスがない。クラス名や名前空間が間違ってない?」とのこと。 プロバイダ「FrontControllerProvider.php」で $c->match('/block/item_list', '\Eccube\Controller\Block\Item_ListController::index')->bind('block_item_list'); 指摘された「Item_ListController.php」では、「ProductController.php」に習って ファイル冒頭の名前空間とクラス名を以下のようにしています。 ---------------------------------------------------- namespace Eccube\Controller; use Eccube\Application; use Eccube\Common\Constant; use Eccube\Event\EccubeEvents; use Eccube\Event\EventArgs; use Eccube\Exception\CartException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class Item_ListController { private $title; public function __construct() { $this->title = ''; } public function index(Application $app, Request $request) { ---------------------------------------------------- クラス名や名前空間はあってるとは思うのですが? プロバイダ「FrontControllerProvider.php」部分で何か間違いでもあるのでしょうか? |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
トップページに商品一覧を出したい | nic | 2019/2/6 0:06 |
Re: トップページに商品一覧を出したい | 468 | 2019/2/6 13:40 |
» Re: トップページに商品一覧を出したい | nic | 2019/2/7 19:49 |
Re: トップページに商品一覧を出したい | 468 | 2019/2/7 21:18 |
Re: トップページに商品一覧を出したい | nic | 2019/2/8 14:13 |