entityType = $entityType; $this->items = $items; $this->itemLabel = $itemLabel; $this->fieldLabel = $fieldLabel; $this->module = $module; $this->secondaryItemLabel = $secondaryItemLabel; if ($selectId) { $this->selectId = $selectId; } else { $this->selectId = $fieldLabel . '_id'; } } public function toHtml() { return View::make('components.simple_select')->with([ 'entityType' => $this->entityType, 'items' => $this->items, 'itemLabel' => $this->itemLabel, 'secondaryItemLabel' => $this->secondaryItemLabel, 'fieldLabel' => mtrans($this->module, $this->fieldLabel), 'selectId' => $this->selectId, ])->render(); } }