What you are looking for is a context which allows to bind a function instead of a template param:
var myContext = {
getLabel: function(feature) {
return feature.attributes.label;
}
};
var template = {
label: "${getLabel}"
};
var style = new OpenLayers.Style(template, {
context : myContext
});
Here are some resources: