EllisLab text mark
Advanced Search
20 of 23
20
   
Modular Extensions - HMVC version 5.4
Posted: 01 November 2012 02:30 AM   [ Ignore ]   [ # 291 ]   [ Rating: 0 ]
Avatar
Joined: 2012-07-19
32 posts
GamBeaT - 01 November 2012 01:30 AM

Hey,

I’ve wanted to download HMVC, but in the “downloads” it says there is nothing to download. do I have to open everything in source and just copy paste the code ? :O

That confused me a bit when I first found this as well… On the ‘Downloads’ page, then select the ‘Branches’ tab and you’ll see links on the right hand side.

wiredesignz - 01 November 2012 01:59 AM

Alter the MY_Loader.php file and add a modified view method.

Check after the modules::find() method that $this->_module value is valid and that the $path value is false. This will indicate that the view does not exist in the module.

Ok cool, thanks.. I’ll try that when I get home tonight and see what I can do, not actually sure if what I’m trying to do will actually work anyway, but there’s only one way to find out. smile I think I’ll base it on an optional extra parameter so I don’t end up breaking something else in the process.

 
Posted: 01 November 2012 10:27 AM   [ Ignore ]   [ # 292 ]   [ Rating: 0 ]
Joined: 2012-11-01
2 posts

thanks, got it smile now got a question, how does this feature works with URI language indentifier ?

 
Posted: 01 November 2012 02:10 PM   [ Ignore ]   [ # 293 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-24
49 posts

I just downloaded codeigniter 2.1.3 and Hmvc 5.4 ,  I found that the controllers method is running two times. here below is the code for

<?php
class Index extends MX_Controller
{
    
function index()
    
{
      
//  $this->load->view('index/index');
       
echo "samit<br>";
    
}
}
?> 

And i Got the result
samit
samit

I think this is a bug.

 Signature 

Murkha Sanga Daiba Daraunchan.(Even gods are afraid of fools)

 
Posted: 02 November 2012 01:14 AM   [ Ignore ]   [ # 294 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@samitrimal, Be sure to post back when you discover that it’s not a bug.

 Signature 

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

 
Posted: 02 November 2012 11:19 AM   [ Ignore ]   [ # 295 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-24
49 posts

hi @wiredesignz,Please check the log generated when i used the code. I am using your extension for first time. I don’t know if i am wrong

modules/test/controllers/index.php
<?php
class Index extends MX_Controller
{
    
public function index(){
        
          $this
->load->model('test/tests_m');
         
$this->tests_m->get_();
            
$this->load->view('test/index/welcome_message');
    
}
}
modules
/test/models/test_m.php
<?php
class Tests_m extends CI_Model
{
    
public function get_(){
        
echo get_class();
    
}
}
?>
modules
/test/views/index/welcome_message.php
<?php 
echo __FILE__;?> 

Output :
/var/www/contact_ci/application/third_party/MX/Loader.php
/var/www/contact_ci/application/third_party/MX/Loader.php
Tests_m/var/www/contact_ci/application/third_party/MX/Loader.php
Tests_m/var/www/contact_ci/application/modules/test/views/index/welcome_message.php/var/www/contact_ci/application/modules/test/views/index/welcome_message.php

Finally Log generated when running the code.

DEBUG - 2012-11-02 20:57:50—> Config Class Initialized
DEBUG - 2012-11-02 20:57:50—> Hooks Class Initialized
DEBUG - 2012-11-02 20:57:50—> Utf8 Class Initialized
DEBUG - 2012-11-02 20:57:50—> UTF-8 Support Enabled
DEBUG - 2012-11-02 20:57:50—> URI Class Initialized
DEBUG - 2012-11-02 20:57:50—> Router Class Initialized
DEBUG - 2012-11-02 20:57:50—> Output Class Initialized
DEBUG - 2012-11-02 20:57:50—> Security Class Initialized
DEBUG - 2012-11-02 20:57:50—> Input Class Initialized
DEBUG - 2012-11-02 20:57:50—> Global POST and COOKIE data sanitized
DEBUG - 2012-11-02 20:57:50—> Language Class Initialized
DEBUG - 2012-11-02 20:57:50—> Language Class Initialized
DEBUG - 2012-11-02 20:57:50—> Config Class Initialized
DEBUG - 2012-11-02 20:57:50—> Loader Class Initialized
DEBUG - 2012-11-02 20:57:50—> Database Driver Class Initialized
DEBUG - 2012-11-02 20:57:50—> User Agent Class Initialized
DEBUG - 2012-11-02 20:57:50—> Template Class Initialized
DEBUG - 2012-11-02 20:57:50—> Session Class Initialized
DEBUG - 2012-11-02 20:57:50—> Helper loaded: string_helper
DEBUG - 2012-11-02 20:57:50—> Session routines successfully run
DEBUG - 2012-11-02 20:57:50—> Controller Class Initialized
DEBUG - 2012-11-02 20:57:50—> Model Class Initialized
DEBUG - 2012-11-02 20:57:50—> File loaded: application/modules/test/models/tests_m.php
DEBUG - 2012-11-02 20:57:50—> Model Class Initialized
DEBUG - 2012-11-02 20:57:50—> File loaded: application/modules/test/views/index/welcome_message.php
DEBUG - 2012-11-02 20:57:50—> File loaded: application/modules/test/views/index/welcome_message.php
DEBUG - 2012-11-02 20:57:50—> Final output sent to browser
DEBUG - 2012-11-02 20:57:50—> Total execution time: 0.0311

Hope, you will believe it now.

 Signature 

Murkha Sanga Daiba Daraunchan.(Even gods are afraid of fools)

 
Posted: 02 November 2012 06:18 PM   [ Ignore ]   [ # 296 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts
samitrimal - 02 November 2012 11:19 AM

...Hope, you will believe it now.

There is no bug in Modular Extensions or Codeigniter causing this.

Your code is the source of all of the problems.

The first problem is that the Index Controller index() method is also the constructor for the class so it will be accessed twice, once when the class is loaded and again when CI runs.

 Signature 

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

 
Posted: 02 November 2012 11:16 PM   [ Ignore ]   [ # 297 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-24
49 posts

Ah , I didnt realized that, index() still works in php 5.3.8

 Signature 

Murkha Sanga Daiba Daraunchan.(Even gods are afraid of fools)

 
Posted: 17 November 2012 09:34 AM   [ Ignore ]   [ # 298 ]   [ Rating: 0 ]
Joined: 2012-02-22
1 posts

@wiredesignz

Just wanted to say thanks for this, works fantastic, great!

 
Posted: 18 November 2012 11:00 AM   [ Ignore ]   [ # 299 ]   [ Rating: 0 ]
Avatar
Joined: 2012-07-19
32 posts

Hey Wiredesignz.. I’m starting a new project and I wanted to check something on your HMVC Wiki page, but BitBucket won’t let me access the page without logging in first now. I don’t have a BitBucket account and I don’t really have any need for one. Any idea what’s going on…?

 
Posted: 18 November 2012 05:27 PM   [ Ignore ]   [ # 300 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-10
2919 posts

@ZaLiTHkA, The Wiki page has been moved to a readme.md file in the source. Try the Overview or Source pages instead.

 Signature 

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

 
Posted: 18 November 2012 05:45 PM   [ Ignore ]   [ # 301 ]   [ Rating: 0 ]
Avatar
Joined: 2012-07-19
32 posts
wiredesignz - 18 November 2012 05:27 PM

@ZaLiTHkA, The Wiki page has been moved to a readme.md file in the source. Try the Overview or Source pages instead.

Ah, yes.. Got it, thanks. Did you by any chance just update the link in your forum sig? Pretty sure I tried that just now and it was still pointing to the /wiki page.. smile

 
Posted: 03 December 2012 05:57 AM   [ Ignore ]   [ # 302 ]   [ Rating: 0 ]
Avatar
Joined: 2012-06-09
82 posts

First of all, thank you so much wiredesignz for this wonderful HMVC solution in CodeIgniter.

Anyway guys I have a question about the best practice in building decoupled modules using HMVC. Maybe someone can help me here - http://ellislab.com/forums/viewthread/230434/

Thanks in advance smile

 
Posted: 03 December 2012 09:02 AM   [ Ignore ]   [ # 303 ]   [ Rating: 0 ]
Avatar
Joined: 2012-02-24
54 posts

I’m building a multilingual website and have organized parts of it in HMVC modules.
In controllers I have this:

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

class 
Site extends MX_Controller {

    
public function __construct()
        
{
        parent
::__construct();
        
}

    
public function index(){
        $this
->lang->load('site_language');
        
$this->load->view('site_header');
        
$this->load->view('site_content');
        
$this->load->view('site_footer');
    
}

In site_header view are country flags images with links for switching languages:

$path 'http://mywebsite.com/images/flags';
echo 
anchor($this->lang->switch_uri('de'), img($path.'/de.png'));
echo 
anchor($this->lang->switch_uri('fr'), img($path.'/fr.png')); 

It doesn’t show the flags. It worked in MVC.
I’m autoloading URL helper but it also does not work if I load it from the module’s controller.
If I put simple a href= and img src= HTML tags, everything works fine, but I want to have only one view file for flags used to switch language. Using HTML tags that would be not so simple.
I’ve tried creating a flags module, but it also does not show flags.
Maybe I should make a function which extends URL helper, I have no other idea.
What else could cause this problem?

Update - The problem is solved:
https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n

I was using i18n version without this comment:
/*
in case you use it with the HMVC modular extension
uncomment this and remove the other lines
load the MX_Loader class
*/

 
Posted: 05 December 2012 04:39 AM   [ Ignore ]   [ # 304 ]   [ Rating: 0 ]
Joined: 2010-02-23
64 posts

Hi wiredesignz, greate job I’m using HMVC from previous versions and works excelent !!

For anyone that wants to have multiple applications sharing a ‘common hmvc core’, I have a ‘redy-to-go’ Codeginiter 2.1.2 + HMVC 5.4.

Example:

/application1  <-  applicacion directory as Codeginiter standard
/application2  <-  applicacion directory as Codeginiter standard
/application3  <-  applicacion directory as Codeginiter standard

/common  <- where resides common corelibrariesmodulesviewshelperthir_party (as HMCV..), etc...
/
system   <- codeigniter core

/wwwapp1   <- document root for   application1 (examplewww.app1.com)
/
wwwapp2   <- document root for   application2 (examplewww.app2.com )
/
wwwapp3   <- document root for   application3 (examplewww.app3.com

Application1, 2 and 3,  can have it’s own domain or subdomain, sharing all the common modules (/common/modules), and also can have it’s own modules (or same, overwritting common modules)


Now, with Zend libraries (2.0.5) and Codeigniter Zend loader !!!


A Post to download source >    http://ellislab.com/forums/viewthread/223678/

 

 
Posted: 05 December 2012 05:11 AM   [ Ignore ]   [ # 305 ]   [ Rating: 0 ]
Joined: 2012-10-27
23 posts

Hey,

Is it possible to use a /language folder in a Module?

Greeets

 
20 of 23
20