Last modified: 2012-03-01 20:47:16 UTC
A new type: `page'.
Created attachment 9780 [details] Implementation of the type.
Adding Jeroen to cc list since he maintains the Validator extension.
AFAIK this has already been applied by Van himself.
> AFAIK this has already been applied by Van himself. No. It was not me. Daniel Werner added something very similar, but named it "Title", not "Page". I do not care about this change, but: Why new type name is capitalized? Other type names are of lower case: `string', `float', `boolean', but this one is `Title'. I want it in lowercase, like other types, because these values are user-visible in my another extension.
> It was not me. Daniel Werner added something very similar Oops, sorry. I got confused there :) > Why new type name is capitalized? It should not be. I will fix this in a moment. > in my another extension. Which one? So if the capitalization issue is fixed, does the title addition help you out or not? If not, please create a new patch that includes the new Criterion and Manipulation classes which you apparently forgot to add.
> Which one? It is not yet published. I once mentioned it -- a parser function which provides templates with Validator functionality. For example: > {{ #validate: > | target = type: page; alias: 1; > | text = type: string; alias: 2; default: {{ PAGENAME: {{{ target }}} }}; > | tooltip = type: string; alias: 3; default: {{ FULLPAGENAME: {{{ target }}} }}; > | link? = type: boolean; default: yes; > }} After it, in template body {{{ target }}}, {{{ text }}}, {{{ tooltip }}}, {{{ link? }}} are ready to use. Before it was bloacked because it required patched Validator (it uses page type), now I have to fix it a bit -- replace `page' with `title'. And I am not settled down with names yet... > So if the capitalization issue is fixed, does the title addition help you out > or not? If not, please create a new patch that includes the new Criterion and > Manipulation classes which you apparently forgot to add. `Title' type is the almost the same as my `Page' type, only names are differ. I think I can use it. If capitalization is fixed, I believe I can use it.
Ping. Please convert `Title' type name to lower case.
r112454 Can this be closed, or do you still need me to do something?
Let me check it with my code.
Ok, this works for me.
The only reason I originally used a capital letter on this was that in PHP basic primitive types such as bool, int or string use lower-case while for object-types we usually use upper case.
I figured as much. Still, these values are not meant to reflect whatever the name of the corresponding type in PHP is. Although I'd go for keeping it all lower case, I'm wondering what the difference is. Van, are you comparing to the string value for some reason? You should use the constants...
As I said, I wrote a "front-end" for Validator to use in templates. So, I have to have string representation for all the types. I decided not to introduce more entities but use values of TYPE_xxx constants. So, title type is represented in PHP code as TYPE_TITLE, and as "title" in template. See example above.
Verified on r112454.