Codeigniter Calendar Class misunderstandment! It is rlly important for me to be done untill Sunday! |
[eluser]GeorgeWeb[/eluser]
Hello dear friends, I am glad that this forum exists. It is amazing and I can find whatever I need except the thing I am asking for right now. Here it is: I am not sure how to pass the year and the month by this link to my funcion called "date" in the "NotebookController" where I will do something only if I get the full date not only the {day}. // The code {cal_cell_no_content} <b href="'.base_url().'NotebookController/date/'.$year.'/'.$month.'/{day}">{day}</a> {/cal_cell_no_content} // I wrote <b> only here in this msg, because <a> shows as a link... // This code is from my model. If you need anything else like more code or even files I am ready to send you I really got to nowhere with this and I tried and I tried a couple of hours... I have searched but there is no answer wherever I look at and everyone says: Try http://ellislab.com/forums, because only they may help you with this. I hope there is a way to do this. I really need and appreciate the help Yours faithfully, George Mirazchiiski!
[eluser]Alucemet[/eluser]
In reality your calendar template is just a view. It should be in a view, and if you want the current month and year, simply pass the month and year to the view from the controller or model you are generating the calendar with. Code: $view_data['year'] = $year; If you need to tweak the actual {content} of the cell, you're going to have to extend the generate method of the calendar class.
[eluser]GeorgeWeb[/eluser]
Man, you are great! This helps but it works only when I get another month and them click on day as link, because in the beggining when I load the calendar my $year and $month are set to NULL, it is because they will show error if there's no value for them. So I wanted to say that if I go to another month it will add it as a param in the url - Example: 2014/02/ and then if I click on a day it will be how I want to be - myfunction/2014/02/{day} but when I firstly load MyController/calendar/ with no params in the url and it shows me the current month but when I click on a day it will be myfunction///{day} and only the day will have value. I am not sure if I explained it very well... Any ideas how to fix this?
[eluser]Alucemet[/eluser]
You can use if statements or ternary operators to switch the month and year between uri segments or defaults. For defaults you can just use date('Y') and date('m').
[eluser]GeorgeWeb[/eluser]
Dear Alucemet, I have to say that you are great guy! Wow, I haven't thought of this solution... it is pretty simple. Thank you very much! Now, I can mark it as done. I wish you all the best! Thank you again! Yours truly, George Mirazchiiski!
[eluser]Unknown[/eluser]
GeorgeWeb, You may find this author’s work interesting… http://zawaruddin.blogspot.com/2012/12/e...niter.html http://zawaruddin.blogspot.com/2013/06/m...niter.html
[eluser]GeorgeWeb[/eluser]
Good job sadfrog! I really like your this event cal My idea is a bit different not exactly connected to events but this can really help in the future. Thanks ! |
Welcome Guest, Not a member yet? Register Sign In |