Awesome! I had a feeling it should work, just haven't seen anyone use that way before, at least not in most tutorials ive encountered. Good to know that you have alternative options for the callbacks.
November 30, 2024 at 4:07 PM
Awesome! I had a feeling it should work, just haven't seen anyone use that way before, at least not in most tutorials ive encountered. Good to know that you have alternative options for the callbacks.
Oh, no it wouldn't cause the app router isn't expecting the direct reference, it's expecting an array with the class and a string name. My original question was to ask why the 3 dot syntax isn't supported
November 30, 2024 at 2:41 AM
Oh, no it wouldn't cause the app router isn't expecting the direct reference, it's expecting an array with the class and a string name. My original question was to ask why the 3 dot syntax isn't supported
Totally fair lol I actually only found out about that syntax earlier this year, and I love it more than just a string name, cause it enables actual reference highlighting in the editor, and I can easily jump to its definition.
November 30, 2024 at 2:25 AM
Totally fair lol I actually only found out about that syntax earlier this year, and I love it more than just a string name, cause it enables actual reference highlighting in the editor, and I can easily jump to its definition.
Ah, okay that's a good reason for the ::class syntax: to instantiate a controller and do some setup. The specific 3 dots syntax inside the parentheses is what I'm talking about, which actually doesn't execute the function, it passes it as a closure-like callback; I'll find the docs later
November 30, 2024 at 1:57 AM
Ah, okay that's a good reason for the ::class syntax: to instantiate a controller and do some setup. The specific 3 dots syntax inside the parentheses is what I'm talking about, which actually doesn't execute the function, it passes it as a closure-like callback; I'll find the docs later
It actually is passing it and not calling. I can't find the docs on mobile, but the 3 dots in between the parens is actual syntax 8.x that passes the function reference instead of calling it.
November 30, 2024 at 1:46 AM
It actually is passing it and not calling. I can't find the docs on mobile, but the 3 dots in between the parens is actual syntax 8.x that passes the function reference instead of calling it.
But why the array with 'MyClass::class' then 'static_class_method_name'? Why not just pass the static class method reference directly via 'MyClass::static_class_method_name(...)'?
November 29, 2024 at 11:27 PM
But why the array with 'MyClass::class' then 'static_class_method_name'? Why not just pass the static class method reference directly via 'MyClass::static_class_method_name(...)'?