It looks like you're new here. If you want to get involved, click one of these buttons!
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Help_model extends Base_module_model {
function __construct()
{
parent::__construct('help'); // table name
}
}
class Helper_model extends Base_module_record {
}
?>
$config['modules']['help'] = array(
'preview_path' => 'about/faq',
);
<?php $CI->load->model('help_model'); ?>
<?php $help = $CI->help_model->find_all(); ?>
<?php foreach ($help as $helpist) : ?>
<div id="block_help">
<?=$helpist->name?>
</div>
<?php endforeach; ?>
Comments
public $record_class = 'Helper';
Also, as a side note, you can use the following as an alternative to get your data from the module:
<?php $help = fuel_model('help', array('find' => 'all)); ?> <?php foreach ($help as $helpist) : ?> <?=$helpist->name?> <?php endforeach; ?>
I'm new at PHP, brand new at CI, and haven't even taken the stickers off Fuel, so it took me a second to figure out where to put that code. For those playing along at home, that would make help_model.php look like this:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Help_model extends Base_module_model { function __construct() { parent::__construct('help'); // table name } public $record_class = 'Helper'; } class Helper_model extends Base_module_record { } ?>
Is there any benefit to using fuel_model('help', array('find' => 'all')); ? Is it quicker? Is it so that if I'm not going to use all the variables I can tell it which ones like this:
$help = fuel_model('help', array('find' => 'one', 'where' => array('name' => $name)));