Created
March 12, 2015 09:20
-
-
Save zmiftah/a978fc8135dfdb5f4c86 to your computer and use it in GitHub Desktop.
Use Heredoc to Save Script and Register it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$script = <<<EOB | |
var data = :data; | |
$('#treeview').treeview({data: %s}); | |
$('#treeview').on('nodeSelected', function(e, node){/* */}); | |
EOB; | |
$script = sprintf($script, json_encode($treeview)); | |
Yii::app()->clientScript->registerScript('loadTree', $script, CClientScript::POS_READY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment