duanmei1894 2015-08-02 19:25
浏览 25

如何在codeigniter中找到滑块图像[关闭]

I have the following code:

<div id="bannerBg">
    <div id="containingDiv">
        <div id="banner-fade">
            <ul class="bjqs">
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/8962835311407882364.jpg">
                </li>
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/15717527901407876556.jpg">
                </li>
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/5158579491407874706.jpg">
                </li>
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/20067615141407882364.jpg">
                </li>
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/17148640751407882364.jpg">
                </li>
                <li>
                    <img alt="bannerimage" class="slider-image" src="http://yousounds.com/admin/img/gallery/original/16658741621407876556.jpg">
                </li>
            </ul>
        </div>
    </div>
</div>

I want to find this code in code igniter. I am new to code igniter and I have no idea how to start, moreover most of the codes don't run in the browser because no direct access is allowed. Someone please help me with this.

  • 写回答

2条回答 默认 最新

  • douzhi9939 2015-08-02 20:54
    关注

    First make a file and save it in controller folder with any name like say image.php(if you using CI 3.X it should be Image.php otherwise it wouldn't work.). Then set it as default controller in the routes.php file(you can find it in config folder). code for controller file should be like this:

    <?php
    //if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    class Image extends CI_Controller 
    {
        function __construct()
        {
            parent::__construct();
        }
    
        public function index()
        {
           $this->load->view('image'); // name of your html file whose code you have written above.
        }
    }
    ?>
    

    And change this http://yousounds.com/admin/img/gallery/original/17148640751407882364.jpg into

    <?php echo base_url(); ?>img/gallery/original/17148640751407882364.jpg
    
    评论

报告相同问题?