Hello
there is

$news=Model::factory('News')->get_news(3)->get_comms(); 

The bottom line: in order to add comments to each news array.

Did the transfer through this, but writes

ErrorException [Fatal Error]: Call to a member function get_comms () on a non-object

Update

  • get_news() searches for records in the database and prints return $this->news;
  • get_comms() with $this->news adds to each news an array with comments and displays.

I need comments on the news, but I don’t know how to do it.

  • What you do not understand from this inscription? "Call to a member function get_comms () on a non-object" - Bastian
  • Updated the question - pettrrr
  • one
    get_news () should return a News class object. Then this chain will work - mountpoint
  • mountpoint, in get_news (), at the beginning insert $ n = Model :: factory ('News'); ? It is possible an example pliz - pettrrr

0