Can't load a view with a string variable?!
Why does the top $this->load->view work with a string literal, but the bottom $this->load->view doesn't work with a variable whose value is the same as the string literal?
<!-- works -->
<?php $this->load->view('_blocks/_listing/events.php')?>
<!-- doesn't work -->
<?php $listing_block = '_blocks/_listing/'.fuel_var('listing_type','').'.php'; ?>
<?php $this->load->view($listing_block)?>
I get the following when I load the page with the listing layout that uses the above code:
Test Event 3
Test Event 4
An Error Was Encountered
Unable to locate the file: _blocks/_listing/events.php
I want to be able to use 1 layout and set the listing block to load from a variable on the page.
Comments