Development

HowToHandlei18nDbFieldsWithAdminGeneratorMethod2 (diff)

You must first sign up to be able to contribute.

Changes between Version 13 and Version 14 of HowToHandlei18nDbFieldsWithAdminGeneratorMethod2

Show
Ignore:
Author:
Mozzy (IP: 94.249.108.243)
Timestamp:
08/30/09 23:29:47 (8 years ago)
Comment:

I removed the exception line and replaced it with a call to the parent's call method to ensure that registered behaviors on a class will still work. It took me a while to find out how to fix this after I used this method of using i18n in the admin generator. I hope that this change will help a lot of other people in the future.

Legend:

Unmodified
Added
Removed
Modified
  • HowToHandlei18nDbFieldsWithAdminGeneratorMethod2

    v13 v14  
    3131  { 
    3232    $data = @split('I18n', $m, 2); 
    33     if( count($data) != 2 )  
    34       throw new Exception('Tried to call unknown method '.get_class($this).'::'.$m); 
     33    if( count($data) != 2 ) { 
     34      // Ensure that behaviors will still work 
     35      return parent::__call($m, $a); 
     36    } 
    3537    list( $method, $culture ) = $data; 
    3638    if (strlen($culture)==4) {