Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Translating Model_Crud Model labels
  • What's the best way to translate my Model_Crud labels set by through $_labels ?
    This is for validation error messages.
  • I usually use the _init() static method, to add the labels at runtime, as you can't use function calls on property definitions.
  • Or with __construct() if it's an instance :
    protected static $_labels = array();
    
    public function __construct()
    {
     parent::__construct();
     static::$_labels = array(
      'name'  => __('Pseudonyme'),
      'birthdate' => __('Date de naissance')
     ); 
    }
    

    Thanks !

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion