O
O
OKNOZA2017-01-29 10:44:33
Kohana
OKNOZA, 2017-01-29 10:44:33

How to output array from controller in Kohana?

Controller

<?php defined('SYSPATH') OR die('No direct access allowed.');
class Controller_Main extends Controller_Template {
  
  public $template = 'index';

  public function action_index(){
    $data = array ("name" => "вася", "age"=>"24", "rost"=>"189");				
   		$this->template->content = View::factory('news');	
  }
}

View - How to get into View to process ? And display the data or process it in the controller, but you need to post the result.
<?PHP
 foreach ($comment AS $key => $value) {
 	
  echo $value. ' - ';
 }
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question