CodeIgniter Forums
Loading the calendar class in views - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Loading the calendar class in views (/thread-3513.html)



Loading the calendar class in views - El Forum - 10-07-2007

[eluser]Leggy[/eluser]
I have loaded it in a constructor but i don't know how to load it in a view. I used $this->library('calendar'); to load the library but it says 'Call to a member function generate()'

Any help would be greatly appreciated, thanks.


Loading the calendar class in views - El Forum - 10-09-2007

[eluser]Leggy[/eluser]
Any help at all?


Loading the calendar class in views - El Forum - 10-09-2007

[eluser]Michael Wales[/eluser]
controller
Code:
/*
  Put all of your configuration stuff here
  $config = array();
*/
$this->load->library('calendar', $config);

view
Code:
<?= $this->calendar->generate($year, $month); ?>



Loading the calendar class in views - El Forum - 10-09-2007

[eluser]Leggy[/eluser]
Ah thanks, silly me. Thanks for the help.