简体   繁体   中英

How to pass a page URL in codeigniter controller

Im buiding a project in codeigniter..

I need to load a page in popup window

Popup window code is :

<div class='opener' data-addclose='true' data-balloon ='{ajax} grid-content.php?Action=0' style='position:relative; margin: auto; clear: both'>View</div>

grid-content.php is file in application\\views\\Adv_Product, how to pass this page url (grid-content.php) in my controller...??

I need to view this page contents in a popup.

How can I place this code in codeigniter...

Please help

Thanks in Advance..

Note : codeigniter does not provide to load directly view,

<div class='opener' data-addclose='true' data-balloon ='<?php echo base_url()?>/demo/popup_view/0' style='position:relative; margin: auto; clear: both'>View</div>

first to make a function inside your controller

Controller name: Demo.php

function popup_view()
{
   // if you send a parameter like action=0 

     $action=$this->uri->segment(3);

    if($action==0)
    {
       $data=array('action'=>'0');
    }
    else
    {
       $data=array('action'=>'');
    }

   $this->load->view('grid-content.php',$data);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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