Klassen Laraknife

Aus Vokabulabor
Zur Navigation springen Zur Suche springen

Links

Comboboxen erstellen

  // Combobox für SProperty-Verweis
  $optionsStatus = SProperty::optionsByScope('notestatus', $fields['status'], 'all');
  // Combobox für Verweis in andere Tabelle:
  $optionsUser = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['user']);

  $context = new ContextLaraKnife($request, $fields);
  return view('note.index', [
    'records' => $records,
    'context' => $context,
    'optionsCategory' => $optionsCategory,
    'optionsStatus' => $optionsStatus,
    'optionsUser' => $optionsUser,
    'pagination' => $pagination
    ]);

In der View:

      <x-laraknife.combobox position="alone" name="status" label="Status" :options="$optionsStatus" class="lkn-autoupdate" width2="4" />
      <x-laraknife.combobox position="alone" name="user" label="User" :options="$optionsUser" class="lkn-autoupdate" width2="4" />