我正在使用Codeignitor slug library来从数据库访问段URL。根据库文档,我所做的一切都很好。有人可以帮我吗...
$id = $this->input->get('id');
$business_data = $this->Constant_model->getDataOneColumn('listings', 'id', $id);
$business_name = $business_data[0]->business_name;
$business_city = $business_data[0]->business_city;
$business_type_name = $this->Constant_model->getDataOneColumn('business_type', 'id', $business_type);
$business_typename = $business_type_name[0]->name;
$business_cat = $this->Constant_model->getDataOneColumn('categories', 'id', $business_category_id);
$business_cat_name = $business_cat[0]->category;
$business_id = $business_cat[0]->id;
$url = $business_youtube;
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
$business_youtube = $my_array_of_vars['v'];
$data['id'] = $id;
$data['title'] = $business_name." - ".$business_cat_name." in ".$business_city;
$data['business_name'] = $business_name;
$data['business_category'] = $business_cat_name;
$config = array(
'table' => 'listing_details',
'id' => $id,
'field' => 'url_slug',
'title' => 'business_name',
'replacement' => 'dash' // Either dash or underscore
);
$this->load->library('slug', $config);
$this->slug->set_config($config);
$this->load->view('business_shop', $data);