Controllers public function name cant be with capital

I try to create a function within a controller but the function does not work if I use a capital letter in my function name. if I keep everything lowercase then he just does it. Is this correct or is this a bug? This is not how i am going to add my code it is just for explanation.

Dont work
app/controllers/page.pgp
public function textBlock()
{
return (object) array(
'title' => 'test'
);
}

page.blade.php
{{ $textBlock->title }}


Works
app/controllers/page.pgp
public function textblock()
{
return (object) array(
'title' => 'test'
);
}

page.blade.php
{{ $textblock->title }}

From controller docs (GitHub - soberwp/controller: Composer package to enable a controller when using Blade with Sage 9):

Camel case is converted to snake case. public function ExampleForUser in the Controller becomes $example_for_user in the Blade template

Oops, didn’t read that part. Thanks for your reply!

This topic was automatically closed after 42 days. New replies are no longer allowed.