【发布时间】:2011-10-15 11:04:35
【问题描述】:
我需要在控制器或模型内的 codeigniter 中打开厚盒。 如何在控制器或模型中写入。
结果将来自模型,所以我需要像这样在厚框中显示结果。请提出任何解决方案。
谢谢
【问题讨论】:
标签: codeigniter thickbox
我需要在控制器或模型内的 codeigniter 中打开厚盒。 如何在控制器或模型中写入。
结果将来自模型,所以我需要像这样在厚框中显示结果。请提出任何解决方案。
谢谢
【问题讨论】:
标签: codeigniter thickbox
控制器: if ( !defined('BASEPATH')) exit('不允许直接脚本访问');
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 */
视图:
<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>
更多信息请访问:bugphp.com 或点击这里Implement ThickBox in Codeigniter
【讨论】:
您需要先学习和理解 MVC。
您不能在模型或控制器中“打开”它,您应该在视图中执行此操作。
在模型中加载数据,在控制器中分配数据,然后在视图中“回显”数据。
但这真的很简单,与codeigniter无关(与普通php和/或html相同)。
也许你可以向我们展示你的代码到目前为止你做了什么。
【讨论】: