私が持っているという名前のコントローラーがcategories
あります
function description($id=null) {
$this->load->helper(array('form', 'url'));
$this->load->library('session');
$this->load->view('category/description');
$this->load->model('userdata_model');
$data = $this->userdata_model->desc($id);
$this->load->view('category/description', $data);
}
これを行うprint_r($data);
と、次の結果が得られます
Array
(
[0] => stdClass Object
(
[id] => 4481
[title] => Dvd Recorder Post
[image_name] =>
[image_name_work] =>
[video_name] =>
[work_type] => tape-recrder
[description] => Test first..
[agency] =>
[services] =>
[photographer] =>
[company] =>
[director] =>
[dop] =>
[userid] =>
[display_order] => 99999
[latest_work] => No
[status] => Active
[post_adddate] => 2012-03-26 10:14:07
[date] => 2012-03-26 10:14:07
[sub_cat] => dvd-reorder
[views] => 75
[url] => Dvd-recorder-post
[post_cache] =>
[post_cat_id] => 0
[post_link] =>
[post_pubdate] =>
[post_seo_url] =>
[post_status] => 0
[post_type] => 0
)
)
ビューページにアクセスしようとすると$data
、次のエラーが表示されますdescription.php
A PHP Error was encountered Severity: Notice Message: Undefined variable: data Filename: category/description.php Line Number: 2
誰かが理由を知っていますか?