CAFPE Docs
  • Class

Classes

  • Article_model
  • Articles
  • Auth
  • Auth_controller
  • Bcrypt
  • Hierarchical_controllers
  • Ion_auth
  • Ion_auth_model
  • MY_Controller
  • MY_Lang
  • MY_Model
  • Pages
  • Private_pages
  • Public_controller
  • Seeder
  • Slug
  • User_sessions
  • Users

Functions

  • action_result
  • actions_widget
  • admin_area_buttons
  • base64_current_url_encode
  • base64_url_decode
  • base64_url_encode
  • current_lang
  • jscript_tag
  • lang_switcher
  • logged_in
  • redirect_lang
  • site_url_lang
  • style_tag

Class MY_Lang

CI_Lang
Extended by MY_Lang
Located at MY_Lang.php

Methods summary

public
# __construct( )
public string
# site_url_lang( string|string[] $uri = '', string $lang = '', string $protocol = null )

Returns site_url() of provided URI adding to its beginning language and first segment translation

Returns site_url() of provided URI adding to its beginning language and first segment translation

Parameters

$uri
URI string or an array of segments
$lang
language to which translate URI first segment
$protocol

Returns

string

Uses

site_url helper (CI_Config alias)
public string
# redirect_lang( string|string[] $uri = '', string $lang = '', string $method = 'auto', string $code = NULL )

Returns redirect() of provided URI using site_url_lang to get the right URI

Returns redirect() of provided URI using site_url_lang to get the right URI

Parameters

$uri
URI string or an array of segments
$lang
language to which translate URI first segment
$method
Redirect method (‘auto’, ‘location’ or ‘refresh’)
$code
HTTP Response code (usually 302 or 303)

Returns

string
public mixed
# translate( string $line, string $orig_lang, $dest_lang )

Translates string from $orig_lang to $dest_lang

Translates string from $orig_lang to $dest_lang

Returns translated string or false if translation not found

Parameters

$line
string to translate
$orig_lang
$lang
$dest_lang

Returns

mixed
string or false
public mixed
# translate_to_id( string $line, string $lang )

Translates string from given lang to identifier

Translates string from given lang to identifier

Returns translated string or false if translation not found

Parameters

$line
string to translate
$lang

Returns

mixed
string or false
public mixed
# translate_from_id( string $id, string $lang )

Translates string from identifier to given lang

Translates string from identifier to given lang

Returns translated string or false if translation not found

Parameters

$id
string id to translate
$lang

Returns

mixed
string or false

Properties summary

public string $current
# ''
protected array $translations_from_id
# array( 'news' => array( 'en' => 'news', 'es' => 'noticias' ), 'article' => array( 'en' => 'article', 'es' => 'noticia' ) )
protected array $translations_to_id
# array()
CAFPE Docs API documentation generated by ApiGen