Active
Project:
Views PHP
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2012 at 01:28 UTC
Updated:
8 Feb 2021 at 23:38 UTC
Jump to comment: Most recent
I've made some code to manipulate a PHP output field.
It's lengthy and I'd like to use it in other views, so, for maintenance reasons, I'd prefer to have only one copy of the code and reference to it from inside the view itself, rather that have multiple versions of the same code in each view.
What would be considered best practise in refactoring this code and getting it referenced from the outside of the view?
i.e. is there a protocol for creating files for this and where they would be located? Would it be the sort of thing I should learn how to make a module for?
Cheers
Duncan
Comments
Comment #1
MilOrg commented+1 on this one...
This is an excellent module, but as Duncan points out, having the ability to include a file would certainly be handy if you either have code you want to reuse in several views, or if the code for a view is lengthy so editing it within the textblock becomes cumbersome.
Ideas & thoughts?
Comment #1.0
MilOrg commentedminor grammar correction
Comment #2
liam morland