Во-первых, вам нужно убедиться, что массив данных, который вы передаете в ваше представление, действительно называется $data['result']
.
На странице контроллера это должно выглядеть примерно так:
// you need to put some data here for checking the number of results returned
if($numberOfRows > 0 ){
$data['result'] = $this->Yourmodel->methodName($arguments);
$this->load->view('yourView');
}
else{
$this->load->view('yourCustomMissingOrErrorView');
}
На странице просмотра это должно быть
<?php
// note if you are just intitialiizing variables, remove the echo statements and put it before all of your html. if you are looping for output then put it where it needs to go in the html
foreach($result as $value){
$title = $this->value->title; // just makes it easier to use if you need to use elsewhere
$text = $this->value->text; // just makes it easier to use if you need to use elsewhere
echo "<h3>" . $title . "</h3>";
echo "<p>" . $text . "</p>";
}
?>