Smileys error help me! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Smileys error help me! (/showthread.php?tid=24819) |
Smileys error help me! - El Forum - 11-20-2009 [eluser]Unknown[/eluser] I read Userguide and I have 2 file. One Controler file: <?php class Smileys extends Controller { function Smileys() { parent::Controller(); } function index() { $this->load->helper('smiley','url'); $this->load->library('table'); $image_array = get_clickable_smileys( base_url().'smileys/', 'comments'); $col_array = $this->table->make_columns($image_array, 8); $data['smiley_table'] = $this->table->generate($col_array); $this->load->view('smiley_view', $data); } } ?> And View smiley_view.php <html> <head> <title>Smileys</title> <?php echo smiley_js(); ?> </head> <body> <form name="blog"> <textarea name="comments" id="comments" cols="40" rows="4"></textarea> </form> <p>Click to insert a smiley!</p> <?php echo $smiley_table; ?> </body> </html> Why I Input Url: http://localhost/index.php/Smileys/ It Show Error: Fatal error: Call to undefined function smiley_js() in C:\Program Files\xampp\htdocs\system\application\views\smiley_view.php on line 5 I do not understand function smiley_js(). How can i fix it! Smileys error help me! - El Forum - 02-17-2010 [eluser]Amar Babu Boddu[/eluser] Fatal error: Call to undefined function smiley_js() on line no.5 I am getting this error when I use smiley. Please help, thanks in advance Smileys error help me! - El Forum - 02-17-2010 [eluser]rogierb[/eluser] $this->load->helper(‘smiley’,‘url’); is not correct. If you want to load multiple helpers, you have to use an array like: Code: $helpers = array('smiley','url'); Smileys error help me! - El Forum - 02-17-2010 [eluser]Amar Babu Boddu[/eluser] Thanks for the reply rogierb Controller: <?php class Smileys extends Controller { function Smileys() { parent::Controller(); } function index() { $this->load->helper('smiley'); $this->load->library('table'); $this->load->helper('url'); $image_array = get_clickable_smileys('smileys/', 'comments'); $col_array = $this->table->make_columns($image_array, 8); $data['smiley_table'] = $this->table->generate($col_array); $this->load->view('smiley_view', $data); } } ?> View: <html> <head> <title>Smileys</title> <?php echo smiley_js('comments','comments');?> </head> <body> <form name="blog"> <textarea name="comments" id="comments" cols="40" rows="4"></textarea> </form> <p>Click to insert a smiley!</p> <?php echo $smiley_table; ?> </body> </html> Can u please tell me where the error is???? Fatal error: Call to undefined function smiley_js() code\application\views\smiley_view.php on line 5 |