EllisLab text mark
Advanced Search
2 of 23
2
   
Modular Extensions - HMVC version 5.4
Posted: 26 March 2011 03:55 AM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts
DBPolito - 26 March 2011 04:05 AM

Hello,

I’ve found a bug with languague autoloader. Sorry but i don’t have the details here, but will be nice if you take a look on it. I just remember that have a wrong param on calling the CI::lang->language(), i’ve fixed the param but still not working.

...

There is no language method in the CI_Lang class.

 Signature 

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

 
Posted: 28 March 2011 12:30 AM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Joined: 2010-10-31
6 posts

Sorry if this is a case of me needing to read more.. but:

Trying to autoload[‘language’] = array(‘sa’);

ends up with the error message: Unable to load the requested language file: language/english/Array_lang.php

Autoloaded helpers and libraries are fine though.

Changing the controller from MY_ to CI_ makes it work..


edit: Made a “MY_controller extends MX controller” with $this->lang-load() in its __construct() and seems to work fine.

In the controller I’m using “home extends MY_controller” I can get a lang->line() out of it.

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

@RGM_, Autoload language is working fine here.

 Signature 

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

 
Posted: 28 March 2011 10:57 AM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Joined: 2009-12-08
7 posts

I think this problem happening only at Reactor Version.

 
Posted: 28 March 2011 04:41 PM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Joined: 2010-10-31
6 posts

Updated to 2.0.1 from codeigniter.com it still comes up with array.

Using wrong version?

 
Posted: 30 March 2011 01:09 PM   [ Ignore ]   [ # 26 ]   [ Rating: 0 ]
Joined: 2011-01-30
6 posts
RGM_ - 28 March 2011 04:30 AM

...
Trying to autoload[‘language’] = array(‘sa’);

ends up with the error message: Unable to load the requested language file: language/english/Array_lang.php

Autoloaded helpers and libraries are fine though.

...

edit: Made a “MY_controller extends MX controller” with $this->lang-load() in its __construct() and seems to work fine…

I’m having this problem too, or at least a similar one. I’m using CI 2 (not Reactor). When trying to use the regular autoload for loading a language, I am presented with the same error as above. The autoload files in the modules directories are working fine for me.

When I remove the language load from the original autoload en place a $this->lang->load() in the constructor of my MY_Controller, everything work fine.

 
Posted: 03 April 2011 05:20 AM   [ Ignore ]   [ # 27 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts

First off, thanks for MX. Your hard work is appreciated.

I have a quick question. Can Modules contain more than 1 controller each? I tried to add a second controller to a module and it doesn’t seem to be working.

I first created a ‘movies’ module, and inside it’s controllers directory, I put in a ‘movies’ controller. I went to

http://my.domain.tld/movies 

and everything worked fine. But then I added a ‘actors’ controller, and tried to go to

http://my.domain.tld/movies/actors 

it didn’t work. I then tried to go to

http://my.domain.tld/movies/actors/index 

and it didn’t work either. When I added a ‘actors’ method to the ‘movies’ controller, that worked without a problem.

My setup is:

app
—/controllers
—/core
—/—/MY_Controller.php (extends MX_Controller)
—/[other stuff]
—/models
—/modules
—/—/movies
—/—/—/controllers
—/—/—/—/movies.php (extends MY_Controller)
—/—/—/—/actors.php (extends MY_Controller)
—/—/—/models
—/—/—/views
—/views

Am I doing something wrong?

EDIT: I forgot to mention that I am using MX 5.4, alongside DMZ 1.8 (in case that helps any)

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 03 April 2011 06:04 AM   [ Ignore ]   [ # 28 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts

disregard previous post. I’m an idiot tongue laugh

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 05 April 2011 10:09 PM   [ Ignore ]   [ # 29 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-19
340 posts

Hey wiredesignz. First, this is great work, I’ve been using your system for a long time, maybe a couple years, I’ve got it integrated into my CMS and it works b.e.a.utifully… however…

I just ran into an issue. My CMS is sort of a fallback system so that basically if the router doesn’t find a controller for the current URI, then it checks the CMS, and if it finds a page, it loads it, otherwise it returns a 404. The issue is, I have a page in the CMS with the slug ‘blog’, and then a module named ‘blog’. The blog page uses the blog module, naturally, but since the CMS is checked AFTER the router does it’s thing, it’s trying to load the content from the blog module. My question is, is there a way to disable the code that loads a module based on the URI, without breaking anything? Essentially for this project, I never want it to load a module right from the URI, I want it to either use an existing controller, or use the CMS.

Thanks!

Edit: I know the easiest thing to do would be either rename the page slug (which I’ve done in the mean time) or rename the module, but the issue is it’s possible with my system that someone could name something the same as a module, and then break their site. I just want to try and make it so that isn’t possible.

 
Posted: 06 April 2011 01:15 AM   [ Ignore ]   [ # 30 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@darkhouse, You could try using a catchall route sending everything to your default controller and use the _remap() method to sort out the URL.

$route['(.*)'$route['default_controller'].'$1'
 Signature 

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

 
Posted: 06 April 2011 06:47 AM   [ Ignore ]   [ # 31 ]   [ Rating: 0 ]
Joined: 2010-12-23
13 posts

hi `m new to hmvc pattern.. could u guide me how to integrate it with CI2.0

 
Posted: 06 April 2011 07:22 AM   [ Ignore ]   [ # 32 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

Did you read the article on HMVC in the WIKI? That explains how to set it up and use it.

HMVC

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: 06 April 2011 07:34 AM   [ Ignore ]   [ # 33 ]   [ Rating: 0 ]
Joined: 2010-12-23
13 posts

@InsiteFX,
thnx for ur reply grin
actually i was converting my application to hmvc. In my application i had a small tweak in MY_router.php . it made me to stumble upon the hmvc installation. now i altered my old my_router.php compatible with HMVC extension. now everything works like charm. Thnx for ur assist grin

 
Posted: 06 April 2011 09:05 AM   [ Ignore ]   [ # 34 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-19
340 posts

@wiredesignz: Yeah, I really wanted to stay away from that. I don’t want to have to add manual routing for every controller each time.

I ended up going through the code and adding a quick fix that seems to be working very well. The only issue is that when you have an update, I’ll have to modify the code again. Here’s what I did.

In application/third_party/MX/Modules.php on roughly line 92, in the load method, I changed to

list($class) = CI::$APP->router->locate($segmentstrue); 

In application/third_party/MX/Router.php on roughly line 63, the locate method, I changed to

public function locate($segments$get_module=false

Then still in that file, on roughly line 79, I changed to

list($module$directory$controller) = array_pad($segments3NULL);
        
if(
$get_module !== false){
            
    
foreach (Modules::$locations as $location => $offset

And added the corresponding close bracket on roughly line 114, right after the foreach closes.

And finally, in application/core/MY_Router.php on roughly lines 32 and 33 I changed to

public function locate($segments$get_module=false){
    
if($located parent::locate($segments$get_module)) return $located

And I believe that’s it. The only other thing I’d like to do is make it a config option so that I can turn the feature on an off for different projects, but I’ll worry about that later.

 
Posted: 20 April 2011 05:59 PM   [ Ignore ]   [ # 35 ]   [ Rating: 0 ]
Joined: 2010-01-28
40 posts

Is it possible to extend the lang library?  I tried dropping application/libraries/MY_Lang.php with:  class MY_Lang extends MX_Lang {... and it did not work.  I was following the instructions on the ME site “All MY_ extension libraries should include (require) their equivalent MX library file and extend their equivalent MX_ class”. 

Looking through the ME code it looks like it never looks for a MY_Lang file, how can I have it search for this first?  Can any MX libraries be extended?

 
2 of 23
2