Support the ongoing development of Laravel.io →
posted 10 years ago
Blade
Last updated 2 years ago.
0

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);
});
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bitlather bitlather Joined 16 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.