バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > FormExtensionがうまくいきません

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
shimbo
投稿日時: 2018/12/18 5:35
対応状況: −−−
半人前
登録日: 2018/10/5
居住地:
投稿: 27
FormExtensionがうまくいきません
[EC-CUBE] EC-CUBE3.0.16
[レンタルサーバ] XServer
[OS] FreeBSD 9.1-RELEASE-p24
[PHP] 5.6.36
[データベース] MySQL 5.7.16
[WEBサーバ] Apache
[ブラウザ] Chrome
[導入プラグインの有無] 自作中
[現象]

以下のようなコードでshoppingの画面にフォームを追加したいのですが、表示されていません。


//OrderTypeExtension.php
namespace Plugin\{プラグインコード}\Form\Extension;

use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;

class OrderTypeExtension extends AbstractTypeExtension
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add(
                'plg_delivery_account', 'text', array(
                'required'=> false,
                'attr' => array(
                  'placeholder'=> 'Please enter Account No of your courier.'
                ),
                'mapped' =>false,
                )
            );
    }

    public function getExtendedType()
    {
        return 'order';
    }
}


    // {プラグインコード}ServiceProvider.php
    $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($types) use ($app) {
        $types[] = new \Plugin\{プラグインコード}\Form\Extension\OrderTypeExtension();
        return $types;
    }));


index.twigでdump(Order)してみたのですが、値が入っていないようです。

Entityやデータベースには登録しないで処理をしたいのですが、そのせいでしょうか?

何かヒントを頂けたら幸いです。


フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
 » FormExtensionがうまくいきません shimbo 2018/12/18 5:35
     Re: FormExtensionがうまくいきません 468 2018/12/18 9:36
       Re: FormExtensionがうまくいきません shimbo 2018/12/18 20:20
         Re: FormExtensionがうまくいきません 468 2018/12/19 11:17
           Re: FormExtensionがうまくいきません shimbo 2018/12/19 12:14

 



ログイン


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

統計情報

総メンバー数は88,288名です
総投稿数は109,688件です

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1567
9
mcontact
1240
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
796
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.