Questions tagged [model]

For questions regarding Models used in software to manage the data, logic and rules of the application.

Filter by
Sorted by
Tagged with
0
votes
3answers
1k views

Store data to other table and get the id

I'm using a method to store information in another table. This is how I'm doing that: public static function CreateMail($userid, $title, $state = 1) { $maildata['userid'] = $userid; ...
2
votes
1answer
976 views

Correct / Best way of calling model methods inside view.html.php

Which is the correct/best method of calling model methods inside view.html.php. Method 1 $mydata = $this->get('MyData') ; Method 2 $model = $this->getModel() ; $mydata = $model->getMyData(...
7
votes
2answers
4k views

How to call a model method from a system plugin?

I have a component ('com_foo') which has a model called 'foobar'. The class declaration is like this: class FooModelbar extends JModelItem This class has a public method called getFooBar(). I also ...
3
votes
1answer
3k views

How to get the form of component from module?

I tried to get a component form from my module. I got the model and then tried to get the form, but the result was empty. I tried to define 'JPATH_COMPONENT' and it was useless. define('...
9
votes
2answers
5k views

How can I use a model of other component in my component?

I'm building a component and It needs access the #__content table. The component com_content does everything that my component needs to do in that table. How can I import the com_content models into ...
5
votes
1answer
1k views

Override com_users model function save

Is it possible to override the com_users save function? This is what I tried so far... <?php echo JPATH_SITE.'/components/com_users/models/profile.php'; require_once JPATH_SITE.'/components/...
2
votes
1answer
370 views

Component in module. addModelPath doesn't seem to work

I am trying to display a component in a module which seems to work using this example http://www.escope.cz/en/blog/94-how-to-load-component-in-a-module I am now facing a problem where my model isn't ...
2
votes
1answer
476 views

From the model, how I can access the data retrieved in the view?

I'm trying to add some external information to a component, and it retrieves the data in view.html.php. Once it is retrieved, how can I use it the model? I've tried as many of the usual variables ...