Browse Source

Fix blade @includes.

Taylor Otwell 12 years ago
parent
commit
9dbbc5848b
2 changed files with 15 additions and 1 deletions
  1. 1 1
      laravel/blade.php
  2. 14 0
      laravel/helpers.php

+ 1 - 1
laravel/blade.php

@@ -256,7 +256,7 @@ class Blade {
 	{
 		$pattern = static::matcher('include');
 
-		return preg_replace($pattern, '$1<?php echo render$2->with(get_defined_vars()); ?>', $value);
+		return preg_replace($pattern, '$1<?php echo view$2->with(get_defined_vars()); ?>', $value);
 	}
 
 	/**

+ 14 - 0
laravel/helpers.php

@@ -426,6 +426,20 @@ function has_php($version)
 	return version_compare(PHP_VERSION, $version) >= 0;
 }
 
+/**
+ * Get a view instance.
+ *
+ * @param  string  $view
+ * @param  array   $data
+ * @return View
+ */
+function view($view, $data = array())
+{
+	if (is_null($view)) return '';
+
+	return Laravel\View::make($view, $data);
+}
+
 /**
  * Render the given view.
  *