33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-12-29 04:42:36 +00:00

Pass data from PHP to JS nicely

This commit is contained in:
Dimitris Grammatikogiannis 2022-01-15 15:48:54 +01:00 committed by GitHub
parent 65b609f8cc
commit 50ca5ba19a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,12 +43,8 @@ else
JHtml::stylesheet('media/com_jedchecker/css/style' . $cssSuffix);
JHtml::script('media/com_jedchecker/js/script.js');
// List of rules
$options = json_encode($this->jsOptions);
JFactory::getDocument()->addScriptDeclaration("var jed_options = $options;");
?>
<script id="jed-rules-json" type="application/json"><?php echo json_encode($this->jsOptions); ?></script?
<div id="jedchecker">
<div class="row g-3">
<div class="col-12 col-md-8">