protected function Xls::getColumnLetterFromFieldName in Excel Serialization 8
Get the column letter for a field name from the headers.
Parameters
array $headers: The header of the worksheet.
string $field_label_or_name: The field label or field name to get the column letter for.
Return value
string The column letter
1 call to Xls::getColumnLetterFromFieldName()
- Xls::encode in src/
Encoder/ Xls.php - Encodes data into the given format.
File
- src/
Encoder/ Xls.php, line 451
Class
- Xls
- Adds XLS encoder support for the Serialization API.
Namespace
Drupal\xls_serialization\EncoderCode
protected function getColumnLetterFromFieldName(array $headers, $field_label_or_name) {
$base_field_header_index_num = array_search($field_label_or_name, $headers) + 1;
return Coordinate::stringFromColumnIndex($base_field_header_index_num);
}