tinyMca with CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: tinyMca with CI (/showthread.php?tid=22358) |
tinyMca with CI - El Forum - 09-06-2009 [eluser]dunken[/eluser] Hi everybody! (Hi, dr Nick). I am about (for the first time) to implement the tinyMCE application (javascript) to a CI-project...and I realy dont know how to do. Is the easiest way to do this by making av new model with a echo statement saying "include this, include that" class Tinymce{ function Tinymce(){ } index(){ echo 'my different .js-files'; } } and after this, just call my tinymca-class every time I need to use it? tinyMca with CI - El Forum - 09-06-2009 [eluser]bobbob[/eluser] did you mean timyMCE? It works very easily with CI tinyMca with CI - El Forum - 09-06-2009 [eluser]dunken[/eluser] i mean tinyMce (sorry for my misspelling). ( http://tinymce.moxiecode.com/ ) shall i proceed as my plan or in some other way? tinyMca with CI - El Forum - 09-06-2009 [eluser]bobbob[/eluser] Add the tiny mce code in your controller and header view as below and then drop the tinymce folder into your js folder in the root of your site. root css images index.php js Also note the xss_clean feature of this forum removed the script tags. Controller: Code: $extrahead = '[removed]script type="text/javascript" src="js/tiny_mce/tiny_mce.js[removed] HEADER VIEW: Code: <head> tinyMca with CI - El Forum - 09-06-2009 [eluser]brianw1975[/eluser] er.... you nearly *always* avoid any form of echo, sprintf, etc from a Model. A more MVC method would be to do something along the lines of (in your controller) Code: class cont exte.......... er{ and then in your view file have: Code: <?php if($data['showTinyMCE'] === true) ?> Like I said, prescribed MVC methodologies put down using models to affect views, but only to give and take data for the controllers. |