Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Notice: Undefined index: model not found 01 Apr 2015 13:33 #12901

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
Hi, i am doing a component correctly, but then i try to add new views.
On those views i want to call a model via:
$model = $this->getModel( 'preordersitem' );
where preordersitem is a model correctly declared on /models
but this model is not found
i get a notice message that says:
Notice: Undefined index: preordersitem ... viewlegacy.php on line 421
i followed the error and i saw that somehow themodel is not found.

any idea ?

Please Log in or Create an account to join the conversation.

Notice: Undefined index: model not found 02 Apr 2015 09:56 #12903

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
Hi,
I solved by doing:

$model = CkJModel::getInstance('preordersitem', 'OrdersCkModel');
$model->setState( 'id', '5');
$model_id ='3';
$this->order = $order = $model->getItem($model_id);
print_r($order);

I get the data correctly but i obtain a warning that says
Error loading component: com_ordersck, Component not found
??
Whats that??

Please Log in or Create an account to join the conversation.

Notice: Undefined index: model not found 03 Apr 2015 10:42 #12904

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
$model = CkJModel::getInstance('preordersitem', 'OrdersModel');


Remove 'Ck'.

Ck is a prefix used for the fork system. At the footer of each file you find the code wich extends Model from CkModel.

It should work.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.057 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started