I have a custom post type events
with various ACF fields. I’m going to display different fields depending on which view it’s on - for example in the calendar view I’ll show date
, time
, location
, and cost
. In the Event Reports page I’ll show date
, report
, and loop through gallery
images. On the Gallery page I’ll just show all the images.
In Controller is it better to specify the fields I need in a controller for each view like this:
class Calendar extends Controller
{
// Pass on multiple fields from Advanced Custom Fields to the view
protected $acf = ['date', 'time' etc...];
}
Or pass them all to everywhere like this:
class App extends Controller
{
// Pass on all fields from Advanced Custom Fields
protected $acf = true;
}