trait LayoutCanvasAwareTrait in TMGMT Translator Smartling 8.4
Hierarchy
- trait \Drupal\tmgmt_smartling_acquia_cohesion\LayoutCanvasAwareTrait
File
- modules/
tmgmt_smartling_acquia_cohesion/ src/ LayoutCanvasAwareTrait.php, line 7
Namespace
Drupal\tmgmt_smartling_acquia_cohesionView source
trait LayoutCanvasAwareTrait {
/**
* @param $json
* @return bool|LayoutCanvas
*/
public function isLayoutCanvas($json) {
if (preg_match('/^\\{"canvas":\\[(.*)\\}$/', $json) !== 1 || empty(json_decode((string) $json))) {
return false;
}
return new LayoutCanvas($json);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LayoutCanvasAwareTrait:: |
public | function |