Reputation: 105
I created a config file for pagination settings .. (application/config/paginaton.php)
and im using i18n in that project, i've tried to use
$config['last_link'] = $this->lang->line('pagination_last_link);
and a lang file (application/language/english/pagination_lang.php)
$lang['pagination_first_link'] = 'First';
$lang['pagination_last_link'] = 'Last';
but it doesn't work...
i'm also using autoload
$autoload['language'] = array('pagination');
-- error message: A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$lang
Filename: config/pagination.php
Line Number: 15
Upvotes: 0
Views: 415
Reputation: 25435
The problem is that your config file is a simple php file containing an array; it doesn't have access to the CI superobject, so the moment you do
$this->lang->line('pagination_last_link')
You're trying am invalid access
I don't know if this might work but try using:
$CI = &get_instance();
$config['last_link'] = $CI->lang->line('pagintion_last_ling');
in your application/config/paginaton.php
Upvotes: 0