38 require_once realpath(dirname(__FILE__).
"/abstract_type_renderer.inc");
60 static function format($value, $template =
"")
62 trace(
"PhoneNumberTypeRenderer function format value is $value", 4);
79 trace(
"PhoneNumberTypeRenderer function standard value is $value", 4);
80 if (!$value)
return "";
84 $phone = implode($valueParts,
"-");
86 $area_code = $valueParts[
"area_code"];
87 $ext = $valueParts[
"extension"];
88 $phone = preg_replace(
"/^$area_code-/",
"($area_code) ", $phone);
90 $phone = preg_replace(
"/-$ext$/",
" ext $ext", $phone);
92 $phone = preg_replace(
"/-*$/",
"", $phone);
105 $value = preg_replace(
"/\\D/",
"", $value);
109 $valueParts = array();
112 foreach(
$parts as $part => $limit)
114 $valueParts[$part] = substr($value, $idx, $limit);
static format($value, $template="")
static getValueParts($value)
PhoneNumberTypeRenderer()
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.