Closed fireburnheart2005 closed 10 years ago
You can use it for log something (separately of \Baseapp\Bootstrap::exception(\Exception $e);
), eg the model validation messages:
namespace Baseapp\Models;
class Users extends \Phalcon\Mvc\Model
{
public function signup()
{
$messages = $validation->validate($_POST);
if (count($messages)) {
return $validation->getMessages();
} else {
// try to create user
if ($this->create() === true) {
return $this;
} else {
// log/display errors
\Baseapp\Bootstrap::log($this->getMessages());
}
}
}
}
On development environment this function displays debug only.
oh,thank you
I don't known what it mean $config->app->env == "development" in function app/boostrap.php
In the public/index.php we use function \Baseapp\Bootstrap::exception($e); and it has $config->app->env == "development"