/** * @param FormView $formView * * @return string */ public function prepareFormLabel(FormView $formView) { $labelParts = $this->getLabelParts($formView); if ($labelParts[0] === '') { $labelParts[0] = 'form'; } // hack for main form: entity_edit, will be entity.edit $mainFormParts = explode('_', $labelParts[0]); unset($labelParts[0]); $labelParts = array_merge($mainFormParts, array('label'), $labelParts); foreach ($labelParts as $i => $labelPart) { $labelParts[$i] = Helper::camelCaseToUnderscore($labelPart); } return implode('.', $labelParts); }
/** * @param string $input * @param string $expect * @dataProvider camelCaseToUnderscoreProvider */ public function testCamelCaseToUnderscore($input, $expect) { $this->assertEquals($expect, Helper::camelCaseToUnderscore($input)); }
/** * @return string */ protected function crudTransPrefix() { return Helper::camelCaseToUnderscore($this->crudName()); }