Subversion Repositories phpLibraryV2

Rev

Rev 41 | Rev 45 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41 Rev 43
Line 274... Line 274...
274
       * replaced, for example
274
       * replaced, for example
275
       * <input type='text' name='~~name~~'>
275
       * <input type='text' name='~~name~~'>
276
       * All instances of ~~name~~ will be replaced 
276
       * All instances of ~~name~~ will be replaced 
277
       */
277
       */
278
      public function templateReplace ( $template, $replacmentStrings, $delimiter = '~~' ) {
278
      public function templateReplace ( $template, $replacmentStrings, $delimiter = '~~' ) {
279
         //print "<pre>" . print_r($replacmentStrings, true) . "</pre>";
279
         //print "<pre>Replacement Strings\n" . print_r($replacmentStrings, true) . "</pre>";
280
         //print "<pre>" . print_r($template, true) . "</pre>";
280
         //print "<pre>Template\n" . print_r($template, true) . "</pre>"; die;
281
         foreach ( $replacmentStrings as $key => $replace ) {
281
         foreach ( $replacmentStrings as $key => $replace ) {
-
 
282
            if ( is_array( $replace ) )
-
 
283
               continue;
282
            $search = '/' . $delimiter . $key . $delimiter . '/';
284
            $search = '/' . $delimiter . $key . $delimiter . '/';
283
            //print "<pre>" . print_r($search, true) . "</pre>"; die;
285
            //print "<pre>" . print_r($search, true) . "</pre>"; die;
284
            $template = preg_replace( $search, $replace, $template );
286
            $template = preg_replace( $search, $replace, $template );
285
         }
287
         }
286
         return $template;
288
         return $template;