 <p>You just need to add a parameter to the function you have:</p> <pre><code>function getBlock($filename){ require_once(YOURBASEPATH . DS . 'layouts' .DS . 'blocks'. DS . $filename .'.php'); } </code></pre>