This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
.... | |
public function login() | |
{ | |
$this->viewBuilder()->layout('external'); | |
if ($this->request->is('post')) { | |
$user = $this->Auth->identify(); | |
if ($user) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//List of international country codes | |
$countries = array(); | |
$countries['AF'] = 93; | |
$countries['AL'] = 355; | |
$countries['DZ'] = 213; | |
$countries['AS'] = 1; | |
$countries['AD'] = 376; | |
$countries['AO'] = 244; | |
$countries['AI'] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function beforeFilter() { | |
//Set the language | |
//checking the browsers language when there's no language session | |
$this->_setLanguage(); | |
//Optional, code for passing the language variables to your controllers/views in a nice way. | |
//Set the language variables | |
$languages['available'] = Configure::read('Config.languages'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function GetCountries($lang="en") { | |
$countries['local'] = unserialize('a:119:{s:2:"AF";s:27:"افغانستان";s:2:"AX";s:6:"Åland";s:2:"AL";s:10:"Shqipëria";s:2:"DZ";s:23:"الجزائر";s:2:"AM";s:47:"Հայաստանի Հանրապետութիւն";s:2:"AT";s:11:"Österreich";s:2:"AZ";s:11:"Azərbaycan";s:2:"BH";s:23:"البحرين";s:2:"BD";s:24:"বাংলাদেশ";s:2:"BY";s:16:"Беларусь";s:2:"BE";s:7:"België";s:2:"BJ";s:6:"Bénin";s:2:"BA";s:19:"Bosna i Hercegovina";s:2:"BR";s:6:"Brasil";s:2:"BG";s:16:"България";s:2:"BI";s:8:"Uburundi";s:2:"KH";s:21:"កម្ពុជា";s:2:"CM";s:8:"Cameroun";s:2:"IC";s:14:"Islas Canarias";s:2:"CV";s:10:"Kabu Verdi";s:2:"CF";s:29:"Ködörösêse tî Bêafrîka";s:2:"EA";s:15:"Ceuta y Melilla";s:2:"TD";s:5:"Tchad";s:2:"CN";s:6:"中国";s:2:"CP";s:15:"Île Clipperton";s:2:"KM";s:26:"جزر القمر";s:2:"CD";s:32:"Jamhuri ya Kidemokrasia ya Kongo";s:2:"CG";s:17:"Congo-Brazzaville";s:2:"HR";s:8:"Hrvatska";s:2:"CY";s:12:"Κύπρος";s:2:"CZ";s:17:"Česká republika";s:2:"DK";s:7:"Danmark";s:2:"DO";s:21:"República Dominicana";s:2:"EG";s:15 |