[eluser]Alexisu[/eluser]
Hello,
I'm sending a link from my Controller to my View page, as follows:
my controller....
Code:
<?php
class Test extends Controller {
function index()
{
$data['info'] = array('<a href="/folder/something/">Link Title</a>', 'Text');
$this->load->view('my_view', $data);
}
}
?>
my_view page....
Code:
<ul>
<?php foreach($info as $item): ?>
<li><?=$item?></li>
<?php endforeach; ?>
</ul>
I'm just getting started with PHP & Codeigniter & I'm sending a lot of data such as this straight to my views from the controller. Furthermore, from my views, I load paragraph text from other nested views.
My question is: Is the above normal practice, or would the 'Model' ideally be involved, or a 'Helper' be used (perhaps for the link)? I'm trying to make sure my content/data is where it should be.
Any tips/advice would be appreciated!
Thanks.
Lex