Topic: Call var in addFilter
Hello users i have a question in addFilter functioçn .
I have this code:
// Get images {gallery} Morfy::factory()->addFilter('content', function($content){ $files = Morfy::getFiles('public/images_folder'); // get files $out = '<div id="gallery">'; foreach ($files as $file) { $out .= '<img class="btn-block" src="'.Morfy::$config['site_url'].'/'.$file.'">'; } $out .='</div>'; return str_replace('{gallery}', $out, $content); });
How to call the url of images like
{gallery id="public/images_folder"}
?