バージョン選択

フォーラム

メニュー

オンライン状況

46 人のユーザが現在オンラインです。 (28 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 46
もっと...

サイト内検索

質問 > その他 > テーブルに列を追加

その他

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
akadota
投稿日時: 2020/10/5 10:39
対応状況: −−−
半人前
登録日: 2020/8/11
居住地:
投稿: 24
Re: テーブルに列を追加
確かに『SamplePageController.php』をサーバーから削除するとEC-CUBEが動きます。namespaceは『namespace Customize\Controller;』となっていますがどこが間違っているのかがわかりません><;

【SamplePageController.phの記述】
namespace Customize\Controller;

use Eccube\Controller\AbstractController;
use Eccube\Entity\BaseInfo;
use Eccube\Entity\Product;
use Eccube\Repository\BaseInfoRepository;
use Eccube\Repository\ProductRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class SamplePageController extends AbstractController
{
/** @var BaseInfo */
protected $baseInfo;

/** @var Product */
protected $productRepository;

/**
* SamplePageController constructor.
* @param BaseInfoRepository $baseInfoRepository
* @param ProductRepository $productRepository
*/
public function __construct(
BaseInfoRepository $baseInfoRepository,
ProductRepository $productRepository
)
{
$this->baseInfo = $baseInfoRepository->get();
$this->productRepository = $productRepository;
}

/**
* @Route("/sample/{id}", name="sample_index")
* @Template("Sample/index.twig")
*/
public function index($id)
{
// $product = $this->entityManager->getRepository('Eccube\Entity\Product')->find($id);
$product = $this->productRepository->find($id);

return [
'shop_name' => $this->baseInfo->getShopName(),
'maker_name' => $product->getMakerName(),
'product_name' => $product->getName(),
];
}
}
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   テーブルに列を追加 akadota 2020/10/3 17:38
     Re: テーブルに列を追加 468 2020/10/4 7:50
     » Re: テーブルに列を追加 akadota 2020/10/5 10:39

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,115名です
総投稿数は110,039件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1649
8
red
1570
9
mcontact
1298
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.