Эта переменная ($ showfields) ожидает Массив атрибутов модели и значения показаны в представлении. (vendor_id). Моя идея заключается в том, что на основе vendor_id назначить один массив атрибутов или другой. есть значения еще. Это даже возможно? < /P>
Это код контроллера: < /p>
Код: Выделить всё
protected $showFields = []; // This is the variable that tells the view what attributes to show
protected $vendorInformation = [...];
protected $noVendorInformation = [...];
public function __construct(QuoteService $quoteService)
{
parent::__construct();
$this->quoteService = $quoteService;
if($this->vendor_id === xx){
array_push($this->showFields, $this->noVendorInformation);
} else {
array_push($this->showFields, $this->vendorInformation);
}
}
Подробнее здесь: https://stackoverflow.com/questions/690 ... uct-method
Мобильная версия