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

Added Template::____call() for BC #38

Closed
wants to merge 1 commit into from

Conversation

fprochazka
Copy link
Contributor

Related #37

*/
public function __call($name, $args)
{
trigger_error('Invoking filters on Template object outside of template file is deprecated, use your filter directly.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like …use getLatte()->invokeFilter() is better, isn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is „use your filter directly“?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filters are usualy shortcuts for existing functions/methods. If this is deprecated, spaghetti like getLatte()->invokeFilter() is definitely a no-go and it's better to directly use that function/method, that the filter is an alias for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is lie, it is not deprecated, i.e. invokeFilter is not deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe using the filter directly is better than spaghetti. If you don't like the formulation, write here how you want it and I will change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You said „I know it's not a best practise, but often I would use the template object helpers in presenter or control.“ :-)

I belive that E_DEPRECATED message should explaind, how to quickly fix it.

@fprochazka fprochazka force-pushed the bc/tpl-call-2 branch 4 times, most recently from 20625fb to a5e76f7 Compare October 11, 2014 22:27
@dg
Copy link
Member

dg commented Oct 26, 2014

merged f6e5a09

@dg dg closed this Oct 26, 2014
@fprochazka fprochazka deleted the bc/tpl-call-2 branch October 26, 2014 17:58
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

Successfully merging this pull request may close these issues.

2 participants