Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Blade::extend(function($content, $blade) {
- $pattern = '/(?<!\w)(\s*)@link\(\s*(.*)\)/';
- preg_match_all($pattern, $content, $matches);
- $links = [
- 1 => 'hello.html',
- 2 => 'about.html',
- 3 => 'keks.html'
- ];
- $replace = [];
- foreach ($matches[0] as $k => $link)
- {
- $replace[$link] = isset($links[$matches[2][$k]]) ? $links[$matches[2][$k]] : '';
- }
- return strtr($content, $replace);
- });
- $view = View::make('test')->render();
- echo $view;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement