Hauptseite: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Tm (Diskussion | Beiträge) |
Tm (Diskussion | Beiträge) |
||
| Zeile 7: | Zeile 7: | ||
== Some Basic Rules == | == Some Basic Rules == | ||
'''Excpetion Handling''' | |||
# All functions of libaries and models should fire an exception if something goes wrong. Do not return "false" or something similar to represent an error. | # All functions of libaries and models should fire an exception if something goes wrong. Do not return "false" or something similar to represent an error. | ||
# All database-queries should be executed via "dbquery($query)". This helper-function provides a pattern for database queries including a correct exception handling. Read more here: [[Helper: dbquery]] | # All database-queries should be executed via "dbquery($query)". This helper-function provides a pattern for database queries including a correct exception handling. Read more here: [[Helper: dbquery]] | ||
# If you want to use a CodeIgniter library you should do this before: | |||
<syntaxhighlight> | |||
$error =& load_class('Exceptions', 'core'); | |||
$error->enable_exceptions(); | |||
</syntaxhighlight> | |||
This will modify the behaviour of "show_error()". Read more here: [[Extended Core: Excpetions]] | |||
== Helper == | == Helper == | ||
Version vom 21. August 2012, 10:53 Uhr
Benutzte Bibliotheken
- CodeIgniter 2.1.1
- jQuery 1.7.2
- jQuery UI 1.8.21
- jsTree Pre 1.0 Fix 1
Some Basic Rules
Excpetion Handling
- All functions of libaries and models should fire an exception if something goes wrong. Do not return "false" or something similar to represent an error.
- All database-queries should be executed via "dbquery($query)". This helper-function provides a pattern for database queries including a correct exception handling. Read more here: Helper: dbquery
- If you want to use a CodeIgniter library you should do this before:
$error =& load_class('Exceptions', 'core');
$error->enable_exceptions();This will modify the behaviour of "show_error()". Read more here: Extended Core: Excpetions
Helper
- dbquery:
Pattern for database queries.
Abstract Models
Abstract model classes are implemented as codeigniter-helper. There is no other way to use the codeigniter-loader without to be forced to instatiate a class.
Model
- Tree:
Abstract class to build a model interacting with a table representing data in a hierachical structure.