Question

I need to open thickbox in codeigniter inside controller or model. How to write there inside controller or model.

the result will be coming from model, so i need to show the result in the thickbox like that. Please suggest any solution.

Thanks

Was it helpful?

Solution

controller: if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Thickbox extends CI_Controller {



    public function __construct() {



        parent::__construct();

        $this->load->helper('url');

        //load ci url helper

    }



    public function index()

    {

        $this->load->view('thickbox_view');

        //load views 

    }

}



/* End of file thickbox.php */

/* Location: ./application/controllers/thickbox.php */

view:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript" src="js/thickbox.js"></script>

<style type="text/css" media="all">

@import "css/thickbox.css";

</style>

</head>



<body>

<a href="/images/single.jpg" title="add a caption to title attribute / or leave blank" class="thickbox"><img src="/images/single_t.jpg" alt="Single Image"/></a>

</body>

</html>

for more information visit: bugphp.com or click here Implement ThickBox in Codeigniter

OTHER TIPS

You need to learn and understand MVC first.
You can't "open" it in model or controller, you should do this in your view.
In model you load the data, in controller you asign it and in view, you will "echo" the data.

But this is really simple thing and has nothing to do with codeigniter (it is the same like in ordinary php and/or html).
Maybe you can show us your code what have you done so far.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top