Show specific value+db to the client and just db value on edit form
Show specific value+db to the client and just db value on edit form
Hello,
I would like to show specific value rather than a db value to the client and db value on edit form.
How to do it?
here my code:
Editor::inst( $db, 'permissions' )
->fields(
Field::inst( 'name' )
->validator( 'Validate::unique' ),
Field::inst( 'icon' )
->getFormatter( function ( $val, $data, $opts ) {
return '<i class="fas '.$val.' nav-icon">';
} )
)
->process( $_POST )
->json();
Note: Above code work fine and show a db value with extra text, but I need your help to show just db value on edit form.
Thanks in advance
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Replies
The best way would be to just return the DB value in that PHP code you posted (i.e. no
getFormatter
), and add that formatting in withcolumns.render
on the client. The fourth example on thecolumns.render
page should get you going,Colin
Thanks Alot colin
perfect