Welcome Guest, Not a member yet? Register   Sign In
Extending CORE class didn't work as expected
#1

[eluser]ReyPM[/eluser]
Hi every:
I'm trying to extend the CI_Calendar class for add multievent per day support which is not included by default. Right now my class, called MY_Calendar and save at libraries/, have this code: http://pastebin.com/cq6A3JTY. Now in my model I have this other code: http://pastebin.com/tq3MLWkw and as yours can see there I setup a $config var but for some reason my code isn't using that $config because the tabel output without styles. Why? I'm missing something or something is wrong in my code?

Regards and thanks in advance
#2

[eluser]weboap[/eluser]
check this thread
http://ellislab.com/forums/viewthread/196998/
#3

[eluser]ReyPM[/eluser]
Hi, I've this already done but to the template is passed a Array so when I build the calendar I get this error:
Quote:A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: libraries/Calendar.php
Line Number: 210

This is the data returned by my function:
Code:
Array ( [1] => Array ( [0] => Event 1 [1] => Different profiles for different groups ) )

And of course if because the template didn't expect a Array just a simple string, my question here is: how to make the template to parse correctly the data? This is my code for the template:
Code:
$template = '
            {table_open}<table class="table table-bordered calendar" id="calendar">{/table_open}
            
            {heading_row_start}<tr>{/heading_row_start}
            {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
            {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
            {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}
            {heading_row_end}</tr>{/heading_row_end}

            {week_row_start}<tr>{/week_row_start}
            {week_day_cell}<td>{week_day}</td>{/week_day_cell}
            {week_row_end}</tr>{/week_row_end}

            {cal_row_start}<tr class="days">{/cal_row_start}
            {cal_cell_start}<td class="day">{/cal_cell_start}

            {cal_cell_content}
                <div class="day_num">{day}</div>
                <div class="day_content">{content}</div>
            {/cal_cell_content}
            {cal_cell_content_today}
                <div class="day_num highlight">{day}</div>
                <div class="day_content"><h4>{content}</h4></div>
            {/cal_cell_content_today}

            {cal_cell_no_content}<div class="day_num">{day}</div>{/cal_cell_no_content}
            {cal_cell_no_content_today}<div class="day_num highlight">{day}</div>{/cal_cell_no_content_today}

            {cal_cell_blank}&nbsp;{/cal_cell_blank}

            {cal_cell_end}</td>{/cal_cell_end}
            {cal_row_end}</tr>{/cal_row_end}

            {table_close}</table>{/table_close}';

Any help with this?




Theme © iAndrew 2016 - Forum software by © MyBB