Welcome Guest, Not a member yet? Register   Sign In
Help with calendar
#21

[eluser]kevinparker[/eluser]
I will read through them.

Thanks for the help

Kevin
#22

[eluser]kevinparker[/eluser]
i read through the links, they give example with array being passed to the view. and i also get an array from the generate function, but i am not able to pass it to the view.

Little help

Regards
Kevin
#23

[eluser]Thorpe Obazee[/eluser]
Code:
// Controller
$data['var'] = 'This is generated by the calendar. It generates a string';

// View
echo $var; 'This is generated by the calendar. It generates a string'
#24

[eluser]kevinparker[/eluser]
How can i find what are the variable that are generated in calendar generate function.

Kevin
#25

[eluser]Thorpe Obazee[/eluser]
You don't. You only need what is generated by the generate method.

Let me modify that

[quote author="bargainph" date="1246973517"]
Code:
// Controller
$data['var'] = 'This IS the calendar. It generates a string';

// View
echo $var; 'This IS the calendar. It generates a string'
[/quote]
#26

[eluser]kevinparker[/eluser]
So to be more specific, calendar return 'out'.

So when i do
Code:
$calendar = $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4),$data);
$this->load->view('calendar', $calendar);

i can call echo $out;

Am i right?

Regards
Kevin
#27

[eluser]Dam1an[/eluser]
No
It doesn't matter what variable name it return it as, you can assign it to whatever string name you want, and you assign it to a variable in an array

Code:
$data['calendar'] = $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4),$data);
$this->load->view('calendar', $data);

And you then access it in the view as $calendar
#28

[eluser]kevinparker[/eluser]
So thats the mistake i was making, that a lot of help. Now i understand what and how to use where.
Now its working

Thanks a lot,

Will be in touch in the forum.

Regards
Kevin
#29

[eluser]Thorpe Obazee[/eluser]
And he said he read the user_guide on Views along with the video tutorials.
#30

[eluser]kevinparker[/eluser]
Yes i read through it, just dint feel that i am making a silly mistake of not putting it in an array, i had the feel that the generate function returns an array.

I will learn.

Thanks bargainph

Kevin




Theme © iAndrew 2016 - Forum software by © MyBB