I want to implement a new module into a site, which is made with CI. I am an absolute newbie with CI and I can not figure out how to create the controller ant the view files. I need the new content to be loaded into an iframe in the current site. So far I have:
controller:
class Module extends Controller {
function __construct() {
parent::Controller();
}
function index() {
$this->common->loadView('module/module');
}
}
view:
<iframe src="/new_module/index.php" width="100%" height="100%" scrolling="NO" frameborder="0" >An iframe capable browser is required to view this web site.</iframe>
route:
$route['module/(:any)'] = "module/$1";
site structure:
resources/
system/
....
new_module/
new_module/index.php
new_module/page1.php
new_module/page2.php
Links should be:
http://mydomain.com/module/page1
http://mydomain.com/module/page2
The link are outside of the iframe and the content should load inside the iframe. So, the iframe src should be changed dynamically.
Obviously, it does not work. Could someone with more experience with CI tell me how it should be done?
Thank you!