contributions/widgets.alphalist/controller/base/routes/parameterizedroutehandlers/numletter.handler.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Handle a single lowercase letter or 0-9 as numeric type 00004 * 00005 * Use like this: /route/{letter:nl} 00006 * 00007 * @author Gerd Riesselmann 00008 * @ingroup Alphalist 00009 */ 00010 class NumletterParameterizedRouteHandler 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 "nl"; 00018 } 00019 00020 /** 00021 * Return regex to validate path 00022 */ 00023 public function get_validate_regex($params) { 00024 return '[0-9a-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 }