Editor Label Array Data Modification

Editor Label Array Data Modification

James12345James12345 Posts: 9Questions: 4Answers: 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: 53,791Questions: 1Answers: 8,369 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: 9Questions: 4Answers: 0

    Thanks, works perfectly.

Sign In or Register to comment.