Skip to content

9) Error and Info Messages

paulcanning edited this page May 5, 2016 · 3 revisions

Error mesages are used to warn user when someting went wrong. Aauth supports built-in errors and user-defined errors.
For example if you are trying yo send pm to yourself, you will get an error. But this errors will not stop executing script.

Another example; if you try to create a group which already created before, you will take "Group exist" error.

The most useful case is logining and registering. If user is entered wrong informations such as short password, unvalid email or unvalid character, you will get error array which consist of all errors.

You can change error messages from Aauth Config file.

Errors are flash data (look Codeigniter sessions). It is only available until next server request.

There is also another option for warnings

error($message)

simply you can create your own error message.

$this->aauth->error('Please fill the form');

get_errors_array()

returns all errors as an array

print_errors($divider = '<br />')

it prints the string which error messages divided with a divider ( default divider is new line char )

infos are same with errors, but it is user for trivial warnings for instance, in check_email() function if email is taken, it will create an info.

info($message)

get_infos_array()

get_infos($divider = '<br />')

Aauth Version 2 has been released

Some functions has changed. Dont forget to scan the new features and functions from Wiki

Clone this wiki locally