contributions/widgets.alphalist/controller/base/routes/parameterizedroutehandlers/letter.handler.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Handle a single, lowercase letter (sl-type) 00004 * 00005 * Use like this: /route/{letter:sl} 00006 * 00007 * @author Gerd Riesselmann 00008 * @ingroup AlphaList 00009 */ 00010 class LetterParameterizedRouteHandler implements IParameterizedRouteHandler { 00011 /** 00012 * Returns the key that is used to identify this handler in route declaration, e.g. "s" or "ui>" 00013 * 00014 * @return string 00015 */ 00016 public function get_type_key() { 00017 return "sl"; 00018 } 00019 00020 /** 00021 * Return regex to validate path 00022 */ 00023 public function get_validate_regex($params) { 00024 return '[a-z]'; 00025 } 00026 00027 /** 00028 * Preprocess a value before URL is build 00029 */ 00030 public function preprocess_build_url($value) { 00031 return String::to_lower($value); 00032 } 00033 }