Agnostic Fetch


The code to fetch the elements from a Craft Element Query is different when the elements have been eager-loaded. For example, to get the first element of a non eagerly loaded field, someField.one(), but for an eagerly loaded field, someField[0] (and that doesn't even get into the error checking). With Agnostic Fetch, you can do someField | one (or one(someField) or craft.agnosticfetch.one(someField)).

The Agnostic Fetch functions are available as twig filters, as twig functions, and as craft variables.


Free

Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


Information

  • Version 2.0.4
  • Last Update 2/4/2019
  • Active Installs 156
  • Compatibility Craft 3
  • License MIT
  • Categories Templating, Development

Report an issue