PHP getValue usage

PHP getValue usage

LapointeLapointe Posts: 430Questions: 81Answers: 4
edited January 2021 in Editor

Hi @all
Hope everybody is fine
Happy new next actual year

Question
I can use

$editor->Field('FieldName')->setValue($ValueToSet);

But how to get an editor field value, for example in preCreate php event ?
I did lot of unsuccessfull try but nowhere succès...
I hope to get value like :

$ValueToGet = $editor->Field('FieldName')->getValue();

Some idea ?

Thanks and be safe

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Answer ✓

    Field->getValue() will just set the value that the field will be given when the data is read from the server.

    If you want to get the value of the field being edited in the preCreate server-side event, use the $values array that is passed into the preCreate event - docs. e.g.:

    $values['FieldName']
    

    Allan

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @allan...
    Of course... So simple.

    Thanks

This discussion has been closed.