Welcome Guest, Not a member yet? Register   Sign In
What $data[] stands for
#1

Hi,

I'm trying to learn more advanced PHP with Code Igniter and i'm starting from the Tutorial in Docs.

There in the News model i have:


Code:
$data['news'] = $this->news_model->get_news();


And in the view i have a foreach:


Code:
<?php foreach ($news as $news_item): ?>


Can i assume that $data['news'] is the same as $news?
Reply
#2

Correct ... see https://www.codeigniter.com/user_guide/g...o-the-view
Reply
#3

Thank you!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB