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

[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?
#82

[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;
#83

[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;
}
#84

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

[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
#86

[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.
#87

[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.
#88

[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!!!!
#89

[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');
#90

[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




Theme © iAndrew 2016 - Forum software by © MyBB