As I was writing this, I figured it out. I wanted to finish writing this in case it could help someone else, though.
Blade::extend(function($view, $compiler){
$pattern = $compiler->createMatcher('paginatePretty');
$code =
'$1<?php
echo "[[[";
#echo $2->getCurrentPage(); --> the bad code
$test = array$2;
echo $test[0]->getCurrentPage();
echo"]]]<br />";
?>';
return preg_replace($pattern, $code, $view);
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community