php - Codemirror not working with Yii view, bootstrap -
i trying integrate codemirror 1 of view in yii 1
but result not good.
please me.
in controller: registered
$cs->registerscriptfile($baseurl.'/js/codemirror.js', \cclientscript::pos_begin); $cs->registerscriptfile($baseurl.'/js/php.js', \cclientscript::pos_begin);
in view.php
<textarea id="editor" name="editor" rows="10" style="width: inherit;"> <?= htmlentities($model->diff_content); ?> </textarea> <script type="text/javascript"> var e = codemirror.fromtextarea(document.getelementbyid("editor"), { mode: "application/x-httpd-php" //theme: 'blackboard' }); /*function app() { var txt = "mytext"; $('textarea#code').text(txt); }*/ </script>
result:
thank much
i found answer question
$cs->registercssfile($baseurl.'/css/codemirror.css', \cclientscript::pos_begin);
it generate
and problem
i have change
$cs->registercssfile($baseurl.'/css/codemirror.css');
without \cclientscript::pos_begin
everything work.
Comments
Post a Comment