Thanks for this really useful module - it adds considerable functionality to an already extremely powerful views module.

I have read as much documentation I can find, however, I can't find out how to give the custom php fields a name of my choosing. By default the module seems to name the fields 'php', 'php_1', 'php_2', etc... Is it possible to change this on an ad hoc basis? Is this built in functionality that I simply can't find? Is this documented somewhere?

If naming the variables is not currently possible I think this would be a great addition, and so I would suggest it as a feature request.

If this feature is not currently available and it is not obvious why anyone would want this, consider the possibility of inserting or re-arranging fields if there are dependencies between fields - computed or static - e.g. php_1 uses the value of php: the view would break. This would be very hard to track down - especially if someone else re-arranged the fields. Also from a maintenance perspective, providing names makes code much more self-explanatory and easier to debug.

Keep up the great work.

Comments

lgammo’s picture

If I understand you correctly, you want to name the php code field so you can view it inside the views UI?

So you edit the php code field and scroll down to more and then enter an administrative title.

I hope this helps.

mautumn’s picture

Hi. No - sorry if I wasn't clear. It has nothing to do with the UI: it is about referring to the fields in PHP code. Just like most developers wouldn't want to be forced to refer to function arguments as arg1, arg2, etc. - they would much rather be able to name them to something meaningful and memorable. With Views PHP it names the calculated fields in the view as php_[#]. I want to be able to name them so that if I have several View PHP fields I can use meaningful names.

This is also important when using embedded/reference views which have Views PHP fields in them - just so we know what the Views PHP fields mean. These are not exposed as the administrative titles - but as as php_[#].

I hope this is clear?

Liam Morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported. If this applies to a later version, please re-open and update the version.