0

I create two view for one component in joomla for backend. When I create my first View it is display properly,but when I create my second View I got this error:

Fatal error: Call to a member function get() on a non-object in C:\xampp\htdocs\Joomla\administrator\components\com_machine\views\machinecategories\tmpl\default.php on line 14

and in my default.php on line 14 I declare this for second view.

$listOrder  = $this->escape($this->state->get('list.ordering'));  //Line 14
$listDirn   = $this->escape($this->state->get('list.direction')); //Line 15
Rizier123
  • 58,877
  • 16
  • 101
  • 156
deval oza
  • 79
  • 1
  • 1
  • 7

2 Answers2

1

Solved:

In default.php there is no mistake.but in my model file i make mistake in my model name..

deval oza
  • 79
  • 1
  • 1
  • 7
0

I'm a starter joomla developer. I hope this helps you a bit. Get the jdbg plugin (free) for joomla. It has krumo (a very nice looking print_r). After you installed the plugin, use it in your code as jdbg::p($this->state); It will print all properties about $this->state. Before calling for $listOrder = $this->escape($this->state->get('list.ordering')); use the jdbg then use a die();. Maybe the $this->state; is not initialised or set in the view. Try to use debug methods too, like xdebug or print the debug_backtrace(); on the template with jdbg.

Krisztián Dudás
  • 856
  • 10
  • 22