phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
JsCode.php
Go to the documentation of this file.
1<?php
2
3namespace Ajax\common;
4
10class JsCode {
11 protected $mask;
12
13 public function __construct($mask) {
14 $this->mask=$mask;
15 }
16
17 public function getMask() {
18 return $this->mask;
19 }
20
21 public function setMask($mask) {
22 $this->mask=$mask;
23 return $this;
24 }
25
26 public function compile($keyAndvalues) {
27 $result=$this->mask;
28 foreach ( $keyAndvalues as $k => $v ) {
29 $result=str_ireplace("%{$k}%", $v, $result);
30 }
31 return $result;
32 }
33}
Base class for js code.
Definition JsCode.php:10
__construct($mask)
Definition JsCode.php:13
compile($keyAndvalues)
Definition JsCode.php:26