Skip to content

Select in game character from Azuriom

Jav edited this page May 18, 2021 · 1 revision

If you are developing some custom extensions, you might want to let the user choose a character.

This is very simple using this code :

<div class="row mb-4">
    @php
        $characters = flyff_user(auth()->user())->characters;
    @endphp

    <form action="{{ route('flyff.cart.update_character') }}" method="POST" class="form-inline">
        @csrf
        <label class="my-1 mr-2" for="inlineFormCustomSelectPref">Choose character : </label>
        <select name="character" class="custom-select my-1 mr-sm-2" id="inlineFormCustomSelectPref">
            @foreach ($characters as $character)
                <option @if((int)$character->m_idPlayer === session('m_idPlayer') ) selected
                        @endif value="{{$character->m_idPlayer}}_{{$character->serverindex}}">{{$character->m_szName}}</option>
            @endforeach
        </select>

        <button type="submit" class="btn btn-warning btn-sm">
            {{ trans('messages.actions.update') }}
        </button>
    </form>
</div>

which will show something like:

select character

Clone this wiki locally