shahroq / whale_c5_cheat_sheet

concrete5 Cheat Sheet
MIT License
70 stars 33 forks source link

Use $app to get the current user #3

Closed mlocati closed 5 years ago

mlocati commented 5 years ago

Currently

$u = new User();

and

$u = $app->make(User::class);

are almost the same.

BTW, because https://github.com/concrete5/concrete5/pull/7433 has been merged into the core, using the $app->make(User::class) approach will be faster than using new User() starting from concrete5 version 8.6, so it's worth using that approach.