2017-11-01 17 views
0

私はコントローラーの前置モジュールを開発していますrenderForm私はweek days.butをロードするためにリストをドロップダウンしています。このドロップダウンリストには1文字だけが表示されますPrestashop

enter image description here

のように表示

public function renderForm() { 

$days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; 

    'input' => [ 

        [ 
         'type' => 'select', 
         'lang' => true, 
         'required' => true, 
         'label' => $this->l('WeekDay'), 
         'name' => 'weekday', 
         'options' => [ 
          'query' => $days, 

         ], 

        ], 
     ] 
    } 

あなたquery値はPrestaShopの1.7あたりのドキュメントとしてフォーマット以下のようにする必要があり要素

Inspect

+0

コンソールがどのように表示されているかを確認してください。いくつかのJやCSSがそれを隠しているかもしれません。 – urfusion

答えて

0

を点検。

$days = array(
    array(
    'id' => 1,  // The value of the 'value' attribute of the <option> tag. 
    'name' => $this->trans('Monday', array(), 'Admin.International.Feature') // The value of the text content of the <option> tag. 
), 
    array(
    'id' => 2, 
    'name' => $this->trans('Tuesday', array(), 'Admin.International.Feature') 
), 
); 
関連する問題