We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Model loading issue.

Development and Programming

rusk's avatar
rusk
4 posts
14 years ago
rusk's avatar rusk

Loading model from _cp file produces lowercase named object in EE, but loading the same model from core module file produces an object with first letter capitalized…

//mcp.myclass.php
class Myclass_mcp {
    function __construct() {
        $this->EE =& get_instance();
    }
    function index() {
        $this->EE->load->model('My_model');
        $data = $this->EE->my_model->get_data();
    }
}

//mod.myclass.php
class Myclass {
    function __construct() {
        $this->EE =& get_instance();
    }
    function index() {
        $this->EE->load->model('My_model');
        $data = $this->EE->My_model->get_data();// this is incorrect
    }
}
       
Dan Decker's avatar
Dan Decker
7,338 posts
14 years ago
Dan Decker's avatar Dan Decker

Hi rusk,

I’m afraid we aren’t set up to offer support when it comes to add-on development. I’ll bring this up to the developers so they can look into it. Thanks for bringing this to our attention.

I’m going to move this into Development and Programming so the discussion can continue.

Cheers!

       
Rob Sanchez's avatar
Rob Sanchez
335 posts
14 years ago
Rob Sanchez's avatar Rob Sanchez

you can just load the model with the lowercase class name

$this->EE->load->model('my_model');

$this->EE->my_model;
       
rusk's avatar
rusk
4 posts
14 years ago
rusk's avatar rusk
you can just load the model with the lowercase class name

thanx. Just searched the documentation and didn’t found strict rules for names capitalisation except for classname declaration. Models usage is not covered by EE documentation too.

I’m afraid we aren’t set up to offer support when it comes to add-on development.

Great. It was not support request. It was a bug report.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.