EllisLab text mark
Advanced Search
load view as new window (ie popup)
Posted: 23 September 2007 07:35 AM
Joined: 2007-09-15
9 posts


I’m happy using $this->load->view(‘myview’) in my controller.

I’d like to be able to load a second view at the same time into a new window like a popup ie:

... some code
$this->load->view('popup');   //want in new window
... some more code 

It seems I can’t specify where my view will load. Any ideas on a workaround?




- Mart

Posted: 23 September 2007 08:01 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-07-14
4237 posts

It’s not possible to create a popup using php alone. The way i create popups on page load is using the jqModal jquery plugin.

The popup is a div with the class popup. and the code is

if($('.popup').length == 1){

If you really want a new window you could do something like

// view
<?php if(isset($popup))echo '<span id="popup" title="'.$popup.'">'} ?>
// javascript
if($('#popup').length == 1){
var popupurl = $('#popup').attr('title');

I’m not so found on popups that do not show their content if there is no javascript.