Sending variable from volt to custom function
问题 I have created a custom function I can access from the volt. The function seems to work fine, but I cannot manage to send the variable to the function. It sends the variable as text instead of its value. The twig function: $volt->getCompiler()->addFunction('getusergroup', function ($user) { return \Models\User::getUserGroup($user); }); The function in the Model: public static function getUserGroup($user) { return UserGroup::find(array('conditions' => 'user_id = ' . $user)); } The lines in