0


I am New to Codeigniter. In my Sample Application I add a new Tab called "RegForm" in my Main.php(View Folder). When i Click the RegForm Tab it load the New Window(width='800px' height='500px'). i understand the concept but i dont know how to write coding in Codeigniter. Basicall i call a function in Controller file when i Clicked the RegForm tab. and i need to call a function in View where i load a window with properties. amm i correct.

1 Answer 1

1

YOu could do this (if I understood correctly):

View 'someview' contains this link:

$atts = array(
              'width'      => '800',
              'height'     => '500',
              'scrollbars' => 'yes',
              'status'     => 'yes',
              'resizable'  => 'yes',
            );
echo anchor_popup('mycontroller/mymethod','Click this for a popup',$atts);

(anchor_popup is a funcion in the URL helper, just autoload it, it's really useful)

in Controller 'mycontroller':

class Mycontroller extends CI_Controller {

    //function index()
    // other functions

    function mymethod() 
    {
      $this->load->model('mymodelforthis');
      $data['properties'] = $this->mymodelforthis->get_properties();
      $this->load->view('myview',$data);
    }
}

THen, in 'myview', you display $properties the way you want Hope this helps, lmk

Sign up to request clarification or add additional context in comments.

6 Comments

Hi Damien , Really Thanks to Reply it got working Greatly. but one thing how to ignore the window shows "Click this for a popup". instead directly load the view. is there any way?
Well, if you want a new page and not a popup, just dont' use the popup ;) Do you mean 'Click this for a popup' shows as page title?
@Damn i need popup window but the window doesn't load the view. it displays href "click this for a popup". i need to load the view in pop up window.
I believe you're implementing something wrong, because it works the way I showed you..are you calling the right controller and views? (like in the example I posted)
ya i made a small mistake. Thanks for co operating @Damien Pirsy
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.