Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

PHP CodeIgniter translating special characters -


is there helper class available codeigniter translate german characters pass thme in url?

for example

ä = ae, ü = ue, ß=ss, ö=oe

thanks in advance.

pyrocms has basic character conversion improved upon:

if ( ! function_exists('url_title')) {     function url_title($str, $separator = 'dash', $lowercase = false)     {         $ci =& get_instance();          $foreign_characters = array(             '/ä|æ|ǽ/' => 'ae',             '/ö|œ/' => 'oe',             '/ü/' => 'ue',             '/Ä/' => 'ae',             '/Ü/' => 'ue',             '/Ö/' => 'oe',             '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|А/' => 'a',             '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|а/' => 'a',             '/Б/' => 'b',             '/б/' => 'b',             '/Ç|Ć|Ĉ|Ċ|Č|Ц/' => 'c',             '/ç|ć|ĉ|ċ|č|ц/' => 'c',             '/Ð|Ď|Đ|Д/' => 'd',             '/ð|ď|đ|д/' => 'd',             '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Е|Ё|Э/' => 'e',             '/è|é|ê|ë|ē|ĕ|ė|ę|ě|е|ё|э/' => 'e',             '/Ф/' => 'f',             '/ф/' => 'f',             '/Ĝ|Ğ|Ġ|Ģ|Г/' => 'g',             '/ĝ|ğ|ġ|ģ|г/' => 'g',             '/Ĥ|Ħ|Х/' => 'h',             '/ĥ|ħ|х/' => 'h',             '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|И/' => 'i',             '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|и/' => 'i',             '/Ĵ|Й/' => 'j',             '/ĵ|й/' => 'j',             '/Ķ|К/' => 'k',             '/ķ|к/' => 'k',             '/Ĺ|Ļ|Ľ|Ŀ|Ł|Л/' => 'l',             '/ĺ|ļ|ľ|ŀ|ł|л/' => 'l',             '/М/' => 'm',             '/м/' => 'm',             '/Ñ|Ń|Ņ|Ň|Н/' => 'n',             '/ñ|ń|ņ|ň|ʼn|н/' => 'n',             '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|О/' => 'o',             '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|о/' => 'o',             '/П/' => 'p',             '/п/' => 'p',             '/Ŕ|Ŗ|Ř|Р/' => 'r',             '/ŕ|ŗ|ř|р/' => 'r',             '/Ś|Ŝ|Ş|Š|С/' => 's',             '/ś|ŝ|ş|š|ſ|с/' => 's',             '/Ţ|Ť|Ŧ|Т/' => 't',             '/ţ|ť|ŧ|т/' => 't',             '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|У/' => 'u',             '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|у/' => 'u',             '/В/' => 'v',             '/в/' => 'v',             '/Ý|Ÿ|Ŷ|Ы/' => 'y',             '/ý|ÿ|ŷ|ы/' => 'y',             '/Ŵ/' => 'w',             '/ŵ/' => 'w',             '/Ź|Ż|Ž|З/' => 'z',             '/ź|ż|ž|з/' => 'z',             '/Æ|Ǽ/' => 'ae',             '/ß/'=> 'ss',             '/IJ/' => 'ij',             '/ij/' => 'ij',             '/Œ/' => 'oe',             '/ƒ/' => 'f',             '/Ч/' => 'ch',             '/ч/' => 'ch',             '/Ю/' => 'ju',             '/ю/' => 'ju',             '/Я/' => 'ja',             '/я/' => 'ja',             '/Ш/' => 'sh',             '/ш/' => 'sh',             '/Щ/' => 'shch',             '/щ/' => 'shch',             '/Ж/' => 'zh',             '/ж/' => 'zh',         );          $str = preg_replace(array_keys($foreign_characters), array_values($foreign_characters), $str);          $replace = ($separator == 'dash') ? '-' : '_';          $trans = array(             '&\#\d+?;' => '',             '&\s+?;' => '',             '\s+' => $replace,             '[^a-z0-9\-\._]' => '',             $replace.'+' => $replace,             $replace.'$' => $replace,             '^'.$replace => $replace,             '\.+$' => ''         );          $str = strip_tags($str);          foreach ($trans $key => $val)         {             $str = preg_replace("#".$key."#i", $val, $str);         }          if ($lowercase === true)         {             if( function_exists('mb_convert_case') )             {                 $str = mb_convert_case($str, mb_case_lower, "utf-8");             }             else             {                 $str = strtolower($str);             }         }          $str = preg_replace('#[^'.$ci->config->item('permitted_uri_chars').']#i', '', $str);          return trim(stripslashes($str));     } } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -