Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.4

[eluser]samitrimal[/eluser]
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
Code:
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.

[eluser]wiredesignz[/eluser]
[quote author="samitrimal" date="1351869573"]...Hope, you will believe it now.[/quote]

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.

[eluser]samitrimal[/eluser]
Ah , I didnt realized that, index() still works in php 5.3.8

[eluser]Unknown[/eluser]
@wiredesignz

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

[eluser]ZaLiTHkA[/eluser]
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...?

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

[eluser]ZaLiTHkA[/eluser]
[quote author="wiredesignz" date="1353274022"]@ZaLiTHkA, The Wiki page has been moved to a readme.md file in the source. Try the Overview or Source pages instead.[/quote]
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

[eluser]rei[/eluser]
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

[eluser]Altazar[/eluser]
I'm building a multilingual website and have organized parts of it in HMVC modules.
In controllers I have this:
Code:
<?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:
Code:
$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/...ation-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
*/

[eluser]XMadMax[/eluser]
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:

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

/common  <- where resides common core, libraries, modules, views, helper, thir_party (as HMCV..), etc...
/system   <- codeigniter core

/wwwapp1   <- document root for   application1 (example: www.app1.com)
/wwwapp2   <- document root for   application2 (example: www.app2.com )
/wwwapp3   <- document root for   application3 (example: www.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/





Theme © iAndrew 2016 - Forum software by © MyBB