CodeIgniter如何在网址中点击图片的id?

时间:2015-07-01 02:32:07

标签: codeigniter

我正在使用codeigniter开发一个网络应用程序。当我尝试点击时 图像(使用细节方法),它不包括链接中图像的ID。

我已经尝试了很多次,但它仍然无效。我甚至在另一个团队成员的PC上运行了同一个项目,但它仍无法在我的电脑上运行。

以下是代码:

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();
    }

当我点击图片时,这就是我得到的:

  

http://localhost:1234/andrasurvey/survey/detail/umur-anda-yang-seharusnya/

我真的需要你的帮助, 谢谢。

0 个答案:

没有答案