<?php $query = $this->News->getLastNews(3); if($query->num_rows() > 0) { $data['lastNews'] = $query->result(); } ?>
Czy jest jakiś sposób w CI, aby wywoływało się to automatycznie?
<?php $query = $this->News->getLastNews(3); if($query->num_rows() > 0) { $data['lastNews'] = $query->result(); } ?>
<?php // ... // ... ?>
<?php class Test { var $test; function __construct() { $this->test = 'TEST'; } } ?>
<?php class Welcome extends Controller { function __construct() { parent::__construct(); } function index() { // ... } } ?>