You are here

protected function Exporter::cssSafe in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/Exporter.php \AKlump\LoftDataGrids\Exporter::cssSafe()
2 calls to Exporter::cssSafe()
HTMLExporter::collapseCell in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/HTMLExporter.php
Collapse a single cell in a row.
HtmlListExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/HtmlListExporter.php
Build $this->output in prep for export/save

File

vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/Exporter.php, line 296

Class

Exporter
Class Exporter

Namespace

AKlump\LoftDataGrids

Code

protected function cssSafe($string) {
  $string = preg_replace('/[^a-z0-9\\-]/', '-', strtolower($string));
  $string = preg_replace('/^\\d/', 'c-\\0', $string);
  return trim(preg_replace('/-{2,}/', '-', $string), '-');
}