CodeIgniter如何在url中获取单击图像的id?
我正在使用codeigniter开发一个web应用程序。当我尝试单击 使用细节方法的图像,链接中不包含图像的ID 我试了很多次,但还是不起作用。我甚至在其他团队成员的电脑上运行过相同的项目,但在我的电脑上仍然无法运行 代码如下:CodeIgniter如何在url中获取单击图像的id?,codeigniter,Codeigniter,我正在使用codeigniter开发一个web应用程序。当我尝试单击 使用细节方法的图像,链接中不包含图像的ID 我试了很多次,但还是不起作用。我甚至在其他团队成员的电脑上运行过相同的项目,但在我的电脑上仍然无法运行 代码如下: public function detail($url_title, $id = '') { // Get user logged in id $user_id = $this->auth->userid();
public function detail($url_title, $id = '') {
// Get user logged in id
$user_id = $this->auth->userid();
// Decode url id
$id = decode_safe_url(@$id);
// Get survey master info
// division 0 mean survey, status 0 is not publish
$survey = $this->egsurveymaster->get(array('id' => @$id, 'division' => '1', 'status != ' => "0"));
// Redirect if product review is not exist
if (!@$survey) {
redirect('andrasurvey');
}
// Update read count
if (isset($_COOKIE['eblo_pcid'])) {
$this->egsurveymaster->count_read(@$id, $_COOKIE['andra_pcid']);
}
// Title
$this->template->title = asset_title('Andra Survey - ' . @$survey->title);
// Vars
$vars = array(
'contents' => array(
'master_id' => @$survey->id,
'review' => $this->_overviewContent(@$survey->id, @$survey),
),
'snsContents' => array(
'title' => @$survey->title,
'image' => asset_url(@$survey->image),
'url' => base_url('andrasurvey/detail/' . url_title(@$survey->title) . '/' . encode_safe_url(@$survey->id)),
'content' => character_limiter(strip_tags(@$survey->content, 150)),
'keywords' => trim(@$survey->title) . ', ',
'username' => 'andraadmin',
),
);
// Content
$this->template->content->view(asset_content('detail'), @$vars);
// publish the template
$this->template->publish();
}
单击图像时,我得到的结果如下:
我真的需要你的帮助,
谢谢。//如果设置了$_COOKIE['andra_pcid']{$this->eSurveyMaster->count_read@$id,$_COOKIE['andra_pcid'];},则更新读取计数。为什么在变量中使用@符号?只是想知道变量是否为空