Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

De-couple helpers from template #77

Closed
johanjanssens opened this issue May 3, 2016 · 0 comments · Fixed by #78
Closed

De-couple helpers from template #77

johanjanssens opened this issue May 3, 2016 · 0 comments · Fixed by #78
Labels
Milestone

Comments

@johanjanssens
Copy link
Member

johanjanssens commented May 3, 2016

Do not pass the $template object to the template helper method to allow them to be used easily outside of the content of a template or view.

Breaking changes:

  • The paginator helper link() method has been renamed to page() and the paginator.pagination now has a 'url' config option that needs to be used to create the url for each page. To migrate your code all template calls to the paginator should include array('url' => route());
  • The grid.sort helper now has a 'url' config option that needs to be used to create the url for sorting. To migrate your code all template calls to the grid.sort should include array('url' => route());
@johanjanssens johanjanssens added this to the 3.0.0-beta.2 milestone May 3, 2016
@johanjanssens johanjanssens changed the title Make template helpers work standalone De-couple helpers from template May 3, 2016
johanjanssens added a commit that referenced this issue May 3, 2016
- Add 'url' config option to pass a HttpUrl object to the helper used to calculate the url for each page
- Set the url for each page using the url object and offset and limit
- Rename link() to page()

BREAKING! The paginator link() method has been renamed to page() and the paginator now has a 'url' config option that needs to be used to create the url for each page. To migrate your code all template calls to the paginator should include array('url' => route());
johanjanssens added a commit that referenced this issue May 3, 2016
- Add 'url' config option to sort() helper method to pass an HttpUrl object to the helper used to calculate the sort url
- Set the url for sorting based on the config options

BREAKING! The grid.sort helper now has a 'url' config option that needs to be used to create the url for sorting. To migrate your code all template calls to the grid.sort should include array('url' => route());
johanjanssens added a commit that referenced this issue May 3, 2016
- Refactor the keepalive helper method to use jQuery and default to window.location.url
- Add a 'url' config option to set a custom url to call
- Use head requests and do not use cache
johanjanssens added a commit to timble/kodekit-platform that referenced this issue May 4, 2016
ercanozkaya added a commit that referenced this issue Feb 26, 2019
#182: Pass template object into helpers (see also #77)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant