ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Modular Extensions - HMVC version 5.4

January 29, 2011 1:58am

Subscribe [99]
  • #91 / Jun 25, 2011 12:01am

    InsiteFX

    6819 posts

    lol

  • #92 / Jun 25, 2011 12:05am

    wiredesignz

    2882 posts

    @InsiteFX, Calls directly to classes are not case sensitive because only one class by this name can ever be loaded.

    <?php echo modules::run('mod_one'); ?>

    This code is ok, you do not need to add controller/method when the controller and module have identical names. The method will default to index in this case.

  • #93 / Jun 25, 2011 12:09am

    InsiteFX

    6819 posts

    ya, I was just showing him how you explain on the WIKI how to do module::run

    Thank’s for the update.

    InsiteFX

  • #94 / Jun 25, 2011 7:33am

    tcgonline01

    2 posts

    Oh thanks every one!
    i changed mod_one_view.php and mod_two_view.php to mod_one.php and mod_two.php, it’s working.

    But it’s not worked when I use Codeigniter Template Class

    mod_one.php

    class Mod_one extends CI_Controller {
        
        public function __construct()
        {
            parent::__construct();
        }
    
        public function index()
        {
               //Write content from a View 'mod_one'to a region 'content'
               //function write_view($region, $view, $data = NULL, $overwrite = FALSE){}
              $this->template->write_view('content', 'mod_one', '', TRUE);
              $this->template->render(); //Render the master template
            }
    }


    mod_two.php

    class Mod_two extends CI_Controller {
        
        public function __construct()
        {
            parent::__construct();
        }
    
        public function index()
        {
               //Write content from a View 'mod_two' to a region 'content'
               //function write_view($region, $view, $data = NULL, $overwrite = FALSE){}
              $this->template->write_view('content', 'mod_two', '', TRUE); 
              $this->template->render(); //Render the master template
            }
    }


    The master template: Application/views/template_main.php

    <html >
    <head>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    
    </head>
    
    <body>
    
    <div><?php echo $content; ?></div>
    <div><?php echo Modules::run('mod_one')?></div> //=> This is not worked
    </body>
    </html>

    plz help me how to use template class and Modular Extensions - HMVC

    you can download template here:

    <a href="http://williamsconcepts.com/ci/codeigniter/libraries/template/">http://williamsconcepts.com/ci/codeigniter/libraries/template/</a>
  • #95 / Jun 25, 2011 8:09am

    InsiteFX

    6819 posts

    What do you have in content? If you r content is empty then it will not display anything!

    InsiteFX

  • #96 / Sep 05, 2011 12:19am

    psychoder

    52 posts

    hello… Modular Extensions - HMVC doesn’t work in CI version 2.0.3..
    what are other config should i do…?

  • #97 / Sep 05, 2011 12:39am

    wiredesignz

    2882 posts

    @psychoder, “doesn’t work” is a bit vague. Could you show the error messages you are receiving.
    Are you using the latest version of Modular Extensions HMVC from bitbucket?

  • #98 / Sep 05, 2011 12:45am

    psychoder

    52 posts

    i don’t think it was the latest.. wasn’t sure…
    bitbucket is freezing the repositories right now… can’t download the latest version..
    but the copy that i have, works fine with CI version 2.0.2… when i upgrade the to 2.0.3 it shows some error…

  • #99 / Sep 05, 2011 1:07am

    wiredesignz

    2882 posts

    @psychoder, Again ...“some error” is a bit vague. Could you show the error messages you are receiving.
    The error may be from your own code.

  • #100 / Sep 07, 2011 8:32pm

    willaser

    7 posts

    Hello there, I have a problem with HMVC. On my localhost it works really good but on the server just works the “default_controller” (it’s a module on modules folder) defined on the routes.php file. If I go to another module, I get a 404 error. Any idea to solve my problem? It isn’t a “base_url” problem, I changed it 😉

    This is the server information:

      VistaPanel version: 2.4.1 RC3
      Operating system: Linux
      Apache version: 2.2.15 (Unix)
      PHP version: 5.2.13
      MySQL version: 5.1.45

    Greetings and thanks!

  • #101 / Sep 07, 2011 9:07pm

    pickupman

    1317 posts

    @willaser
    Was your localhost host running on Windows? Windows will run without regard to file case. Sometimes when uploading to linux the file case will cause a problem. Also, have you tried changing $config[‘uri_protocol’]  to one of the other parameters?

  • #102 / Sep 08, 2011 5:31am

    willaser

    7 posts

    Thanks for you answer. My localhost runs on Windows. Now, I have tried it with the other paremeters of “uri_protocol”, but this still doesn’t run. Maybe changing anything on .htaccess file?

    Greetings.

  • #103 / Sep 08, 2011 6:15am

    willaser

    7 posts

    It was a problem with $config[‘index_page’]. Everything is ok now. Thanks!

  • #104 / Sep 09, 2011 11:40am

    haydenp

    46 posts

    Using HMVC (V5.3.4) and CI (V2.0) I have been bale to extend MX_Lang and in the __construct() I had access to the likes of CI::$APP->config->item(‘index_page’). However, Using HMVC (V5.4) and CI (V2.0.3), the same will throw a fatal error ‘Fatal error: Class ‘CI’ not found in ...’ see below.

    What is the best way to resolve this?

    I have tried:

    global $URI, $CFG, $IN;
    $config =& $CFG->config;
    $index_page = $config['index_page'];

    ... and it does seem to work, but it is the correct/best way?

    ==//==

    HMVC = V5.3.4
    CI = V2.0

    /**
     * MY_Lang
     * Location: application/core/MY_Lang.php
     */
    class MY_Lang extends MX_Lang
    {
        function __construct()
        {
            $index_page = CI::$APP->config->item('index_page');
            CI::$APP->uri->uri_string = 'some string';
        }    
    }

    HMVC = V5.4
    CI = V2.0.3

    /**
     * MY_Lang
     * Location: application/core/MY_Lang.php
     */
    class MY_Lang extends MX_Lang
    {
        function __construct()
        {
            $index_page = CI::$APP->config->item('index_page');
            CI::$APP->uri->uri_string = 'some string';
        }    
    }
    Fatal error: Class 'CI' not found in ...application/core/MY_Lang.php ...
  • #105 / Sep 09, 2011 12:04pm

    wiredesignz

    2882 posts

    The CI class should be available it’s static. Something else in your code might be preventing the CI class from loading.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases