Jun 24, 2014

Function check_plain() deprecated

Use String::checkPlain() instead.

For example,
use Drupal\Component\Utility\String;
$addupdate_form['optimizely_project_code'] = array(
  '#type' => 'textfield',
  '#default_value' => String::checkPlain($project_code),
  // Other fields ...
);
Update:  See the later post  Drupal 8, Beta 15 --> RC 1: Eliminating use of checkPlain().

Sources:

Replace calls to check_plain() with Drupal\Component\Utility\String::checkPlain()
https://www.drupal.org/node/2089331

30 Awesome Drupal 8 API Functions You Should Already Know, Fredric Mitchell
http://brightplumbox.com/d8apifunc-austin/#/4/1

No comments:

Post a Comment