EllisLab text mark
Advanced Search
1 of 23
1
   
Modular Extensions - HMVC version 5.4
Posted: 29 January 2011 02:58 AM   [ Ignore ]
Avatar
Joined: 2007-06-10
2919 posts

Modular Extensions - HMVC version 5.4 is available from Bitbucket. (see my signature below)

CodeIgniter version 1.7 is no longer supported.

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 29 January 2011 10:09 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-12-14
544 posts

Just updated a project of mine to ci 2.0 official and HMVC 5.4, and wanted to thank you for the excellent work
you made with hmvc smile

 
Posted: 30 January 2011 07:37 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2009-03-10
1388 posts

Thanks again wiredesignz. Your extensions has helped a lot.

 Signature 

Isset | Isset Public Code Repo | Simple Message Library | Session Profiler for CI2.0 | CI session issues in IE

 
Posted: 30 January 2011 04:04 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

Thank you ver much, wiredesignz…

InsiteFX

 Signature 

Ceritfied State of CT Computer Programming Teacher.
Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

 
Posted: 30 January 2011 08:17 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2010-07-01
23 posts

Hey wiredesignz,

Thanks, fantastic.  One quick point - it seems I can not use the get_instance() funtion in a library when the controller has inherited from MX_Controller.  Any plans to change this?  Or should I be finding a workaround for each of my libraries?

(I raised this in an earlier post, http://ellislab.com/forums/viewthread/179478/)

Much appreciated,

Kim

 
Posted: 30 January 2011 08:28 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

With HMVC you need to pass into or set the controller instance for the library before using it.

$this->load->library('form_validation');
$this->form_validation->CI =& $this;

/* or */

$this->load->library('form_validation', array('CI' => $this)); 

And then process the parameters inside the library constructor yourself.

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 30 January 2011 10:34 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2010-07-01
23 posts

Thanks.

 
Posted: 31 January 2011 09:21 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2009-11-16
35 posts

Thanks, wiredesignz.

I have a doubt: Can I load a config file from a module using application/config/autoload.php $autoload?

 
Posted: 31 January 2011 07:17 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2010-07-01
23 posts

Hi wiredesignz,

Another quick point.  When I’m not using HMVC, I can access controller properties in a view using $this->variable.  As soon as MY_Controller inherits from MX_Controller, however, the property is no longer available.

I’ve been reading up on the CI object hierarchy, including this article by David Upton, http://www.packtpub.com/article/codeigniter-and-objects but I,‘m having difficulty understanding how this changes when we use HMVC…

Any assistance appreciated…, Kim

 
Posted: 01 February 2011 06:18 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-09
314 posts

most useful and very much appreciated!

thanks, wiredesignz!

 Signature 

Starfish Web Consulting Web Design & Development Belfast

Quicksnaps - CI Photo gallery app

 
Posted: 02 February 2011 01:24 AM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

The Modular Extensions HMVC, Bitbucket repository has been updated.

The Modules::$locations array may now be set in the application/config.php file. ie:

/*
|--------------------------------------------------------------------------
| Modules locations
|--------------------------------------------------------------------------
*/
    
$config['modules_locations'= array(
        
APPPATH.'modules/' => '../modules/',
    ); 
 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 02 February 2011 08:31 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2008-12-14
544 posts
wiredesignz - 31 January 2011 01:28 AM

With HMVC you need to pass into or set the controller instance for the library before using it.

$this->load->library('form_validation');
$this->form_validation->CI $this;

/* or */

$this->load->library('form_validation', array('CI' => $this)); 

And then process the parameters inside the library constructor.

Hmm, i never had to do that, it just works like normal CI does.
Any thoughts why it is working without doing your suggested trick ?

 
Posted: 06 March 2011 01:51 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-06
5 posts

Hi wiredesignz!

First of all thanks to codeigniter and all of its friendly users.

Im a big fan of codeigniter and HMVC and I’d been using this for a couple of years.

I have issues regarding codeigniter 2.0 and HMVC 5.4.

I try to use the new feature of codeigniter 2.0 which is the so called package. Using CI 2.0 I autoload the foo_bar folder that contains class called Sample with method name called tae. here is my class located in APPPATH.‘third_party/foo_bar/libraries’:

<?php 
class Sample
{
    
function tae()
    
{
        
echo 'Sample output ===!';    
    
}

my autoload.php looks like:

/*
| -------------------------------------------------------------------
|  Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
|  $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/

$autoload['packages'= array(APPPATH.'third_party/foo_bar'); 

when I try to load the ‘Sample’ class I get some error:

An Error Was Encountered
Unable to load the requested class: sample

Here is my controller:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Welcome extends MX_Controller {

    
function __construct()
    
{
        parent
::__construct();
        
        
$this->load->library('sample');// error occurs here
        
        
$this->sample->tae();
    
}

    
function index()
    
{
        $this
->load->view('welcome_message');
    
}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */ 

but when I try to use the add_package_path:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Welcome extends MX_Controller {

    
function __construct()
    
{
        parent
::__construct();
        
        
$this->load->add_package_path(APPPATH.'third_party/foo_bar');
        
$this->load->library('sample');
        
        
$this->sample->tae();
    
}

    
function index()
    
{
        $this
->load->view('welcome_message');
    
}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */ 

No errors occured. So the problem is the autoloading of package doesnt working. Some help is appreciated. Im using the latest codeigniter reactor 2.0 and HMVC version 5.4

Thanks and more power! ^.^

 
Posted: 06 March 2011 02:19 AM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

Yes, I haven’t updated Modular Extensions yet for autoloading package paths. I will do this soon.

You could copy the CI_Loader::_ci_autoloader code for autoloading packages and add it to the MX_Loader class if you need this urgently.

 Signature 

URI Language Identifier | Modular Extensions - HMVC | View Object | Widget plugin | Access Control library

 
Posted: 06 March 2011 02:27 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-06
5 posts

@wiredesignz: Thank you so much for a rapid reply!

God Bless! ^.^

 
Posted: 07 March 2011 10:55 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2009-01-24
25 posts

I have a question. I’ve read the documentation and the philosophy behind HMVC looks exactly what i’m looking for.
However I’m concerned about the performance impact that it might have on large scale applications…

Does HMVC required much additional memory?
Does it add significant processing time to codeigniter?

 
1 of 23
1