CodeIgniter Forums
Is it possible give a view a target? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Is it possible give a view a target? (/showthread.php?tid=7344)



Is it possible give a view a target? - El Forum - 04-04-2008

[eluser]Joozt[/eluser]
I was wondering if it is possible to give a view a target. I can't really find this information in the user guide, so I was wondering if anyoen knows that.

So for example I want to load a view in a new browser window, like a popup.

Thanks in advance.


Is it possible give a view a target? - El Forum - 04-04-2008

[eluser]xwero[/eluser]
I think a view shouldn't be aware of where it is loaded, that is a job for html and javascript. I use jquery and jqmodal for this example
Code:
// controller
$popup['content'] = $this->load->view('content','',true);
$page['msg'] = $this->load->view('popup',$popup,true);
$this->load->view('page',$page);
// views popup.php
<div class="jqmWindow" id="msg">&lt;?php echo $content; ?&gt;</div>
// site.js
if($('#msg').length == 1)
{
    $('#msg').jqm().jqmShow();
}