Controllers don't work when dealing with CPT that has underscores.
My CPT is cnm_yacht
template:
single-cnm_yacht.blade.php works!
Controller:
SingleCnmYacht Controller doesn't work

Temporary solution is adding $template var to controller
but.. is there a better alternative?
if not... can we add this to instructions?
class SingleCnmYacht extends Controller {
protected $template = "single-cnm_yacht";
public function ok() {
return "hola";
}
}
This line is also a good helper to find out hierarchy:
put this one in your template:
$hierarchy = new Brain\Hierarchy\Hierarchy();
var_export( $hierarchy->getTemplates($wp_query) );
Controllers don't work when dealing with CPT that has underscores.
My CPT is cnm_yacht
template:
single-cnm_yacht.blade.php works!
Controller:
SingleCnmYacht Controller doesn't work
Temporary solution is adding $template var to controller
but.. is there a better alternative?
if not... can we add this to instructions?
This line is also a good helper to find out hierarchy:
put this one in your template: