嗨,我有一个问题如何将杂货店与 phils 模板库一起使用,这是我的代码控制器
public function user_management() {
$crud = new grocery_CRUD();
$crud->set_subject('User');
$output = $crud->render();
$this->template->set_layout('blog');
$this->template->set('output', $output);
$this->template->title('home', 'Grocery-Crud');
$this->template->build('grocery');
}
这是我的看法
<?php foreach($css_files as $file): ?>
<?php endforeach; ?>
<?php foreach($js_files as $file): ?>
<?php endforeach; ?>
<?php echo $output; ?>
我收到类似的错误
A PHP Error was encountered Severity: Notice Message: Undefined variable: css_files Filename: views/grocery.php Line Number: 2 A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/grocery.php Line Number: 2 A PHP Error was encountered Severity: Notice Message: Undefined variable: js_files Filename: views/grocery.php Line Number: 5 A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/grocery.php Line Number: 5 A PHP Error was encountered Severity: 4096 Message: Object of class stdClass could not be converted to string Filename: views/grocery.php Line Number: 10
请帮忙