Editor Label Array Data Modification

Editor Label Array Data Modification

James12345James12345 Posts: 14Questions: 5Answers: 0

I am returning an Editor field label as an array, however the notes field I am combining contains HTML markup which I would like to remove server side. I have a PHP function to do this but is there a way to call the function on the notes field before returning?

Field::inst( 'telephoneCode' )
        ->options( Options::inst()
            ->table( 'dialCodes' )
            ->value( 'id' )
            ->label( array('dialcode','notes')  )

Ideally I want to strip all HTML from the notes field.

Any assistance is appreciated.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Yes, there is a render method which can be called on the Options instance which will let you do that.

    Regards,
    Allan

  • James12345James12345 Posts: 14Questions: 5Answers: 0

    Thanks, works perfectly.

This discussion has been closed.