CI_Lang::line PHP Method

line() public method

Fetches a single line of text from the language array
public line ( string $line, boolean $log_errors = TRUE ) : string
$line string Language line key
$log_errors boolean Whether to log an error message if the line is not found
return string Translation
    public function line($line, $log_errors = TRUE)
    {
        $value = isset($this->language[$line]) ? $this->language[$line] : FALSE;
        // Because killer robots like unicorns!
        if ($value === FALSE && $log_errors === TRUE) {
            log_message('error', 'Could not find the language line "' . $line . '"');
        }
        return $value;
    }

Usage Example

Example #1
0
 /**
  * Fetch a single line of text from the language array
  *
  * @access	public
  * @param	string	$line the language line
  * @return	string
  */
 public function line($line = '')
 {
     $value = parent::line($line);
     if ($value === FALSE) {
         return $line;
     }
     return $value;
 }
All Usage Examples Of CI_Lang::line