symfony - Symfony2 – Is there a standard for the name of entity var inside a controller & view? -
i'm curious if there's standard/recommended practice name of variable storing entity in controller action or view.
public function demoaction(user $entity) { return $this->render('...', [ 'entity' => $entity, ]); } i've seen places it's done way (always name main entity var $entity) , other's $entity $user (for example).
in opinion, using $entity everywhere get's confusing when there 2 entities , either have 1 called "entity" , other else.
is there standard/recommended practice? symfony? or maybe wider php world? or orm, ie, doctrine?
yeah, call them are, $user, $userprofile ...
the $entity autogenerated stuff symfony creates. maybe behavior optimized in symfony3, generated variable names derived concrete class name.
Comments
Post a Comment