Hello Micheal,
normally when i use php I handle the errors this way:
This is the controller:
require_once 'model/buche.php';
switch($action)...
case 'buchen':
$buchen = new Buche();
$errors = $buchen->getErrors(); break;
include "view/$action" . ".php";
the errors are implement like this through the checkmethod
public function checkEnde() {
if (!isset($this->ende) || $this->ende == "") {
$this->errors = "Das Endefeld sollte ausgefüllt werden";
}
}
I display the errors in an view or work it it out in a helper.
My Problem with Joomla is:
I´ve got this code:
class TablePost extends JTable {
...
public $hits = 0;
...
public function __construct( &$db ) ...
public function check() {
if ($this->title == '') {
$this->setError(JText::_( 'Please subscribe the titel field' )); }
}
For example i want to the Error:$this->setError(JText::_( 'Please subscribe the titel field' ));
in the model to import it into the view to display them and tell the users what they got to do.
At the Joomi api i read that the JTable->setError method is inherited from the Jobjectm but even when I call the jobject::getErrors();
Jobject errors is an empty array();
Do i have something missunderstood?
Kind regards
Chris
Am Sonntag, 12. August 2012 18:13:05 UTC+2 schrieb chrisnorthstar:
Thanks, It works now it seems that the task you want to register have to be the same as the executed task.