• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modular Extensions - HMVC version 5.4

[eluser]boytun[/eluser]
hhhhh,ok
So, What do you think cause this problem ?

[eluser]wiredesignz[/eluser]
@boyfun,

I have already told you that the code you have posted does not relate to the error message you have provided.

[eluser]boytun[/eluser]
Hello

In the mvc view I load my module like this
<?php echo Modules::run('widg_html') ; ?>
but I get this error:
Quote:A PHP Error was encountered
Severity: Notice

Message: Undefined property: Widg_html::$db

Filename: models/mdl_widg_html.php

Line Number: 12


Fatal error: Call to a member function get() on a non-object in C:\xampp\htdocs\application\modules\widg_html\models\mdl_widg_html.php on line 12
this is my module's controller:
Code:
class Widg_html extends MX_Controller {

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

  $this->load->model('mdl_widg_html');
}

public function index()
{
   //$this->load->database();
  $data['widget_body']=Mdl_widg_html::get();
  $this->load->view('display',$data);
   //echo base_url();
}
}

And this is my module's model:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Mdl_widg_html extends CI_Model {
public function __construct()
{
  parent::__construct();
}

public function get()
{
  
  return $this->db->get('widg_html');
}

}

Please help me
Thanks in advance

[eluser]boytun[/eluser]
Hello
I need to load my module into my application's view, but I can't.
My module work fun if I excuted from localhost/mymodule, but if I call It from the view(echo Modules::run('mymodule')) I get this:
Code:
Cannot redeclare class CI in C:\xampp\htdocs\application\third_party\MX\Base.php on line 57

Code:
application/
+ controllers/
    + main.php (extending Frontend_Controller)->load view display
+ core/
    + MY_Controller.php (extending CI_Controller)
+modules
    + mymodule
+librairies
    +Frontend_Controller (extending MY_Controller)
+views
    +display

Thanks in advance

[eluser]wiredesignz[/eluser]
@boyfun,

You need to learn about the difference between calling static methods in classes and calling methods in object context.

Remember also, if you wish to use the HMVC features built into Modular Extensions HMVC then "all" of your controllers must extend the MX_Controller class.

[eluser]boytun[/eluser]
I extend all my controller with MX_Controller like this:
Code:
application/
+ controllers/
    + main.php (extending Frontend_Controller)->load view display
+ core/
    + MY_Controller.php (extending MX_Controller)
+modules
    + mymodule
+librairies
    +Frontend_Controller (extending MY_Controller)
+views
    +display

but I get a page full of errors.

[eluser]boytun[/eluser]
When I do this I get many errors like:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI::$data

Filename: MX/Controller.php

Line Number: 58

Quote:A PHP Error was encountered

Severity: Notice

Message: Indirect modification of overloaded property Page::$data has no effect

Filename: libraries/Frontend_Controller.php

Line Number: 10

Quote:A PHP Error was encountered

Severity: Notice

Message: Indirect modification of overloaded property Page::$data has no effect

Filename: controllers/page.php

Line Number: 14

And many others

[eluser]boytun[/eluser]
.

[eluser]wiredesignz[/eluser]
@boyfun,

Every time you post you have different classes with different class extensions and different errors. None of these errors relate to Modular Extensions HMVC directly.

All of these errors are due to your inexperience with OOP, PHP.and CodeIgniter.

I respectfully suggest that you do some research on the specific PHP errors you are encountering. You might actually learn something new and not have to constantly spam these forums with your problems.

[eluser]quasiperfect[/eluser]
@wiredesignz is posible to deactivate routing for some models?

let's say we have the modules test and test1 i would like to have www.domain.ext/test but not www.domain.ext/test1


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.