Welcome Guest, Not a member yet? Register   Sign In
CI v2.0 and Modules
#1

[eluser]kerell78us[/eluser]
I am seeking to use CI in a modular fashion similar to the way joomla operates.

For example:
I have modules such as: Latest News (latest_news.php) and Most Viewed (most_viewed.php). I would like to have to the modules loaded into my main controller (homepage.php)

I have installed Modular Extensions - HMVC by wiredesignz,and my main controller is as follows:

Code:
/* Homepage.php */
<?php Homepage extends CI_Controller {
  
public function __construct() {
   parent::__construct();
}

public function index() {
  $data = array();



  $this->load->view('homepage', $data);
}

}
<?php

/* THIS IS THE MODULE */
/* latest_news.php */
<?php Latest_News extends MX_Controller {
  
public function __construct() {
   parent::__construct();
}

public function index() {
  $data = array();



  $this->load->view('latest_news', $data);
}

}
<?php


/* HOMEPAGE VIEW */

<html>
<head>  </head>


<body>
<?php echo Modules::run('latest_news/lastest'); ?>
</body>

</html>

Could you guuys kindly advise whether I am going about this the right way.
#2

[eluser]InsiteFX[/eluser]
I think for what you want! You would need to use widgets
by wiredesignz, for displaying the data.

A good place to look is at PyroCMS.

InsiteFX
#3

[eluser]kerell78us[/eluser]
[quote author="InsiteFX" date="1294487498"]I think for what you want! You would need to use widgets
by wiredesignz, for displaying the data.

A good place to look is at PyroCMS.

InsiteFX[/quote]

Thanks, InsiteFX!

I tried it and it is exactly what I needed, now I can finally start my CI project.
#4

[eluser]gowrav vishwakarma[/eluser]
try CI for Joomla

Best of two worlds
1) Php developers : CI
2) Best CMS: Joomla




Theme © iAndrew 2016 - Forum software by © MyBB