Skip to content
This repository
Browse code

Merge pull request #42 from thisislawatts/master

Easy Variable Dumping
  • Loading branch information...
commit 3de660794b8aaaee3cb8aa74c77a9964a6c1b44c 2 parents a6aa285 + 4914948
Anthony Kolber authored April 17, 2012

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  extensions/twig-extensions.inc.php
19  extensions/twig-extensions.inc.php
@@ -25,12 +25,30 @@ public function getFunctions() {
25 25
     return array(
26 26
       'sortbydate' => new Twig_Function_Method($this, 'sortbydate'),
27 27
       'sortby' => new Twig_Function_Method($this, 'sortby'),
  28
+      'debug' => new Twig_Function_Method($this, 'var_dumper'),
  29
+      'pebug' => new Twig_Function_Method($this, 'var_dumper_pre'),
28 30
       'get' => new Twig_Filter_Method($this, 'get'),
29 31
       'slice' => new Twig_Filter_Method($this, 'slice'),
30 32
       'resize_path' => new Twig_Filter_Method($this, 'resize_path'),
31 33
     );
32 34
   }
33 35
 
  36
+	#
  37
+	#		dump out our var for easy debugging
  38
+	#
  39
+	public function var_dumper($input) {
  40
+		var_dump( $input );
  41
+	}
  42
+	
  43
+	#
  44
+	#  dump out our var for easy debugging ++ Now with Extra Pre's
  45
+	#
  46
+	public function var_dumper_pre($input)	{
  47
+		echo "<pre>";
  48
+		print_r( $input );
  49
+		echo "</pre>";
  50
+	}
  51
+
34 52
   #
35 53
   #   manually change page context
36 54
   #
@@ -62,6 +80,7 @@ function resize_path($img_path, $max_width = '100', $max_height = '100', $ratio
62 80
     }
63 81
   }
64 82
 
  83
+
65 84
   #
66 85
   # allow offsetting and limiting arrays
67 86
   #

0 notes on commit 3de6607

Please sign in to comment.
Something went wrong with that request. Please try again.