select two labels

select two labels

churchilchurchil Posts: 34Questions: 5Answers: 0

i want a second label called 'nachname' how can i get this?

Field::inst ( 'id_person' )
->options( Options::inst()
->table( 'personen' )
->value( 'id_person' )
->label( 'vorname' )

Replies

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    ps this in my staff.php

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Do you mean a second field, or two labels for the same field? I don't follow.

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    two labels for the same field

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    The label is what's displayed on the form during editing so the user knows what the field is - it only makes sense to have a single label. What's the use case for two?

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    already got it

        Field::inst ( 'id_person' )
            ->options( Options::inst()
                ->table( 'personen' )
                ->value( 'id_person' )
                ->label( array( 'vorname', 'nachname') )
                ->where (function ($t) {
                    $t->where( 'vorname', '', '!=');
                })
            ),
    

    thx

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    how does it works when i need DATE IS NULL (like in the SQL Query)?

    $t->where('date', IS NULL);

This discussion has been closed.