简体   繁体   English

在新窗口中加载Codeigniter视图

[英]Load a codeigniter view in a new window

I am looking for a way to open a report in a new window using codeigniter. 我正在寻找一种使用Codeigniter在新窗口中打开报告的方法。 Still I did not find a proper way to do this. 我仍然没有找到合适的方法来做到这一点。 I need to send an array of data to this view as well and I think that won't be a big problem as following code normally used to pass an array of data to a view. 我还需要向该视图发送数据数组,我认为这不会是一个大问题,因为通常使用以下代码将数据数组传递给视图。

$this->load->view('report',$data);

My problem is how to open it in a new window using JavaScript,jQuery or PHP if there is a method. 我的问题是,如果有方法,如何使用JavaScript,jQuery或PHP在新窗口中打开它。 Some help will be really helpful. 一些帮助将非常有帮助。 Thanks. 谢谢。

Try this way: 尝试这种方式:

echo anchor('controller/function', 'Show in New Window', array('target' = > '_blank'));

Or maybe you can use JQuery trick 或者也许您可以使用JQuery技巧

使用HTML,您可以在新页面中打开链接,例如:

<a href="link of report loding controller/function" target="_blank" >REPORT</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM