iframe in view php |
[eluser]jupiter1031[/eluser]
I have a module in the view folder that basically is the container for an iframe. The Iframe module will display data from the database. My first problem is how to correctly use 'src="something.php"' within the iframe statement. 'something.php' is also in the view folder. I need to pass the database information to that module. The website is a rework of www.greiner-engineering.com select projects from the navbar. All the project information will be in a database and the screen needs to scroll. Any suggestion is appriciated.
[eluser]Twisted1919[/eluser]
[quote author="jupiter1031" date="1297834866"] My first problem is how to correctly use 'src="something.php"' within the iframe statement. 'something.php' is also in the view folder. I need to pass the database information to that module.[/quote] For "something.php" you will create a class method named something and you will do all the logic there (including the loading of view files) then simple, reference it in the src attribute like: src="<?php echo site_url('my_controller/something');?>" and it will load your custom method . DO NOT refrence the view file directly, like http://www.mydomain.com/application/views/something.php because you will be in big troubles, just learn how it needs to be done in CI way.
[eluser]Basketcasesoftware[/eluser]
Seems to work pretty good for me. I like! Good gallery. :coolsmile:
[eluser]jupiter1031[/eluser]
Thank you for your help. As you see at the example below I have created a method put_project. In eng-projects.php I successfully implemented the iframe like this Code: <iframe id="dsp_projects" src="<?php echo site_url('project/put_project');?>" frameborder=0 scrolling=auto height=720 width=900>></iframe> These are the controller methods of class Project: Code: function get_year_query()
[eluser]Twisted1919[/eluser]
put_project() is a new request that doesn't have anything to do with get_year_query() therefore you need to query the database again and populate $data once again, then pass it .
[eluser]jupiter1031[/eluser]
Thank you for your help! Very much appreciated! |
Welcome Guest, Not a member yet? Register Sign In |