<?php echo Asset::css('common.css'); ?> //or <?php echo Asset::css(array('common.css', 'common2.css')); ?>
<?php echo Asset::js('jquery.js'); ?> //or <?php echo Asset::js(array('jquery.js', 'common.js')); ?>
class Uri extends Fuel\Core\Uri { public function __construct($uri = NULL) { parent::__construct($uri); $this->detect_language(); } public function detect_language() { if ( ! count($this->segments)) { return false; } $first = $this->segments[0]; $locales = Config::get('locales'); if(array_key_exists($first, $locales)) { array_shift($this->segments); $this->uri = implode('/', $this->segments); Config::set('language', $first); Config::set('locale', $locales[$first]); } } }
/** * Localization & internationalization settings */ 'language' => 'en', // Default language 'language_fallback' => 'en', // Fallback language when file isn't available for default language 'locale' => 'en_US', // PHP set_locale() setting, null to not set 'locales' => array( 'en' => 'en_US', 'ro' => 'ro_MD', 'ru' => 'ru_RU', ),
Autoloader::add_classes(array( // Add classes you want to override here // Example: 'View' => APPPATH.'classes/view.php', 'Uri' => APPPATH.'classes/uri.php', ));
function url($uri = '', $named_params = array()) { $lang = Config::get('language'); if ( ! empty($uri)) { $lang .= '/'; } if ($named_uri = Router::get($uri, $named_params)) { $uri = $named_uri; } return Uri::create($lang.$uri); }
<a href="<?php echo url('histoire'); ?>">Link Name</a>
return array( '_root_' => 'welcome/index', // The default route '_404_' => 'welcome/404', // The main 404 route '(histoire|storia)' => 'welcome/histoire', );
return array( '_root_' => 'welcome/index', // The default route '_404_' => 'welcome/404', // The main 404 route 'history' => 'welcome/history', );
It looks like you're new here. If you want to get involved, click one of these buttons!