Closed CupOfTea696 closed 9 years ago
Not as far as I know. The files need to follow the naming convention of the wordpress template hierarchy .
Alright. That's a bit of a shame though.
Any workaround?
Create a hook that modifies how WordPress calculates which template to use. Not a very good Idea but it could work.
That's what I had in mind I tried hooks like "index_loaded" without success
Try template_redirect or template_include maybe? More can be found here
works, but this code is specific to .blade.php
, maybe BLADE_EXT
should be an array containing (.blade.php
, the official blade extension and .php
)
public function template_include_blade( $template ) {
/** ... **/
Laravel\Blade::sharpen();
$bladeName = str_replace('.php', '.blade.php', $template);
$bladeExtTemplate = locate_template([basename($bladeName)]);
if (file_exists($bladeTemplate)) {
$template = $bladeExtTemplate;
}
$view = Laravel\View::make( 'path: ' . $template, array() );
/** ... **/
}
should I make a PR ?
Can't hurt.
Hi, would it be possible to allow including files named .blade.php instead of just .php? Or is that not possible?