Calendaring Class??? - 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: Calendaring Class??? (/showthread.php?tid=4464) |
Calendaring Class??? - El Forum - 11-26-2007 [eluser]JimmyJ[/eluser] Hey, i'm very new to cl and i'm going through the documentation. I really really like it, but i'm stuck at something very simple!! I'm going through the simple blog tutorial and i can't figure out how to spit out a simple calendar (or any other class for that matter) into my blogview.php page. Code for blog.php is: Code: <?php And my blogview.php is Code: <html> How do i spit out the calendar to the page? Calendaring Class??? - El Forum - 11-26-2007 [eluser]Pandabeer[/eluser] Your view acts as a return statement. Place $this->load->library('calendar'); above the view load->view function and it should work. Calendaring Class??? - El Forum - 11-26-2007 [eluser]JimmyJ[/eluser] Yeh, that worked. Thankyou Calendaring Class??? - El Forum - 03-06-2008 [eluser]oliviermarian[/eluser] Hi, I was looking for kind of the same information. My problem is that the calendar is loaded in first in the view, meaning it appears top of page. What I do to place it where I want is that I use the personalisation of the calendar template to add <div> settings in the template, so that to calendar is displayer where I want in my view. $prefs['template'] = '{table_open}<div STYLE="border-style:hidden; position: absolute;top:50px;left:100px"><table border="0" cellpadding="0" cellspacing="0">{/table_open}.....' It works but the HTML code source of the generate view (the webpage) is awfull as the calendar is generated before the <head> and <body>.... What is the clean way to do this ? how do you manage to insert the calendar in the right place of the view ? thxs. olivier. Calendaring Class??? - El Forum - 03-06-2008 [eluser]Pandabeer[/eluser] You are possible using the generate function in the controller instead of the view. You could also generate it and put it in a variable and then give it to view, instead of echo'ing in your controller, which is not really the way to go. It's all up to you. Calendaring Class??? - El Forum - 03-06-2008 [eluser]oliviermarian[/eluser] Hi Yes i was calling Code: $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $data); I tried in the view but it does not work... Are you sure it can be called from the view ? My view code is: Code: <html> this generates this error Code: A PHP Error was encountered Calendaring Class??? - El Forum - 03-06-2008 [eluser]Pandabeer[/eluser] You can load the library in the controller, with the preferences. You need to echo the generate function. Then it should work. Calendaring Class??? - El Forum - 03-06-2008 [eluser]oliviermarian[/eluser] Sorry, you were right; I was noob ;-) it works now! for the next noob; here is the code.. in the controler: Code: function calendar() Code: <html> |