<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
Class Pattern_categories extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index($categoryId = null)
{
// set your variables
$vars = array('page_title' => 'Check out our list of patterns | Campbell Custom Coatings');
if(!is_null($categoryId)) {
//$this->load->model('pattern_categories_model'); // IF I UNCOMMENT THIS LINE I GET THE ERROR
//$vars['patterns'] = $this->pattern_categories->get_patterns_by_id($categoryId);
}
// use Fuel_page to render so it will grab all opt-in variables and do any necessary parsing
$page_init = array('location' => 'pattern_categories', 'render_mode' => 'cms');
$this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init);
$this->fuel_page->add_variables($vars);
$this->fuel_page->render();
}
}
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Pattern_categories_model extends Base_module_model {
public $record_class = 'Pattern_category';
function __construct()
{
parent::__construct('pattern_categories');
}
It looks like you're new here. If you want to get involved, click one of these buttons!