Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change signature of renderResource #191

Open
bakura10 opened this issue Feb 14, 2015 · 1 comment
Open

Change signature of renderResource #191

bakura10 opened this issue Feb 14, 2015 · 1 comment

Comments

@bakura10
Copy link
Member

After a bit of usage, I've realized that the order of parameters is a bit inconsistent. When creating a a ResourceViewModel, it is:

return new ResourceViewModel(['user' => $user], ['template' => 'user']);

However the resourceRender helper work like this:

$this->renderResource('templateName', ['user' => $user]);

I'm considering changing that for 0.5 to keep the same order. What do you think @grizzm0 ?

@grizzm0
Copy link

grizzm0 commented Feb 14, 2015

Nah. The current signature matches ViewModel($variables, $options); aswell as partial($template, $variables) and partialLoop($template, $variables);

They make sense imho as the model doesn't always require options and is therefore less important.
Same goes for the renderers. They require template name which should be prio 1. They however don't require variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants