[Solar-talk] Creating a new class using Solar
Paul M Jones
pmjones at solarphp.com
Fri Oct 13 10:42:16 PDT 2006
On Oct 13, 2006, at 12:35 PM, Rodrigo Moraes wrote:
> On 10/13/06, Matt M. wrote:
>> I have to define my own methods for
>> config get/set and for localized strings too?
>
> Additionaly:
> The config array is available $this->_config, so, inside the class:
> - get config value: $value = $this->_config['key'];
> - set config value: $this->_config['key'] = $value;
>
> Localized strings should not be used in the controller I think, unless
> for error messages in exceptions. For exceptions you can use:
>
> throw $this->_exception('ERROR_CODE');
>
> Then define ERROR_CODE in the Locale file for the front controller
> class (/Controller/Locale/en_US.php).
Quick note: if you use ERR_CODE, then $this->_exception() will also
look for Class_Name_Execption_CODE and throw it for you (instead of a
generic exception).
Will respond more on these later; Rodrigo, excellent summary!
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list