CodeIgniter Forums
Modular Extensions - HMVC version 5.4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Modular Extensions - HMVC version 5.4 (/showthread.php?tid=38057)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


Modular Extensions - HMVC version 5.4 - El Forum - 06-04-2011

[eluser]osci[/eluser]
I have a question regarding checking the existence of modules.

Let's say I have a module that makes calls to other modules. Is there a way of knowing if a module exists before trying to call it?

In HMVC there is not such functionality.

Should I write a helper to check for folder existence or should I keep registry of installed modules?

Could this feature be added to Modules class?


Modular Extensions - HMVC version 5.4 - El Forum - 06-06-2011

[eluser]quasiperfect[/eluser]
hi

using latest reactor with latest hmvc
i get a error Fatal error: Cannot access protected property CI_Form_validation::$CI
if i try to use $this->form_validation->CI =& $this;


Modular Extensions - HMVC version 5.4 - El Forum - 06-06-2011

[eluser]wiredesignz[/eluser]
Extend CI_Form_validation (MY_Form_validation) and make $CI a public variable.
Code:
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation
{
    public $CI;
}



Modular Extensions - HMVC version 5.4 - El Forum - 06-06-2011

[eluser]quasiperfect[/eluser]
thanks @wiredesignz that solved the problem


Modular Extensions - HMVC version 5.4 - El Forum - 06-06-2011

[eluser]eokorie[/eluser]
why am i getting this on my pages?

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI::$controller

Filename: MX/Loader.php

Line Number: 266

I have the latest reactor and using the latest hmvc


Modular Extensions - HMVC version 5.4 - El Forum - 06-06-2011

[eluser]wiredesignz[/eluser]
@eokorie, Looks like I introduced a typo on line 266 with my previous update.

I have just corrected that and pushed the fix to Bitbucket. Thanks.


Modular Extensions - HMVC version 5.4 - El Forum - 06-07-2011

[eluser]DBPolito[/eluser]
Hello wiredesignz,

Congratulations again for your work.

I had a problem here but i don't know if it is really a bug, let me try to explain for you.

When i'm on this page assignment/student/view, i can't call other controller with the same name, like: modules::run('book/student/search').

Can you undestand me? I think you can't load another module with the same controller name.

Thanks.


Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]tcgonline01[/eluser]
Hi Wiredesignz, I have a problem with: Modules::run('module_name/method').
there are 2 modules:
Code:
../modules
    |- /mod_one
    |    - /controllers / mod_one.php
    |    - /views / mod_one_view.php
    |
    |- /mod_two
         - /controllers / mod_two.php
         - /views / mod_two_view.php


mod_one.php
Code:
class Mod_one extends MX_Controller {
    
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
      $this->load->view('mod_one/mod_one_view.php')
    }
}

mod_two.php
Code:
class Mod_two extends MX_Controller {
    
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
      $this->load->view('mod_two/mod_two_view.php')
    }
}


mod_one_view.php
Code:
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />    
    <title>view one</title>
</head>

<body>
<?php
  echo "This is view of mod_one module";
?>
</body>
</html>


on mod_two_view.php i use Modules::run('mod_one') or Modules::run('Mod_one') or Modules::run('mod_one/index')... but it not worked.

mod_two_view.php
Code:
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />    
    <title>tess</title>
</head>

<body>

<?php
  echo Modules::run('mod_one'); //but An Error Was Encountered
                                //Unable to locate the file: mod_one.php
?>

</body>
</html>


Plz help me!!!!


Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]wiredesignz[/eluser]
If you extend MX_Controller you only use the module name prefix when loading a view from a view sub-directory or from a different module. MX_Loader knows which module to load from.
Code:
$this->load->view('mod_one_view');



Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]InsiteFX[/eluser]
Try lower case name!
Code:
<?php
  echo modules::run('mod_one'); //but An Error Was Encountered
                                //Unable to locate the file: mod_one.php
?>
// Proto type:
<?php echo modules::run('module/controller/method', $param, $...);

InsiteFX