| @@ 853-868 (lines=16) @@ | ||
| 850 | * |
|
| 851 | * @return mixed |
|
| 852 | */ |
|
| 853 | protected function getElementClassString() |
|
| 854 | { |
|
| 855 | $elementClass = $this->getElementClass(); |
|
| 856 | ||
| 857 | if (Arr::isAssoc($elementClass)) { |
|
| 858 | $classes = []; |
|
| 859 | ||
| 860 | foreach ($elementClass as $index => $class) { |
|
| 861 | $classes[$index] = is_array($class) ? implode(' ', $class) : $class; |
|
| 862 | } |
|
| 863 | ||
| 864 | return $classes; |
|
| 865 | } |
|
| 866 | ||
| 867 | return implode(' ', $elementClass); |
|
| 868 | } |
|
| 869 | ||
| 870 | /** |
|
| 871 | * Get element class selector. |
|
| @@ 875-890 (lines=16) @@ | ||
| 872 | * |
|
| 873 | * @return string |
|
| 874 | */ |
|
| 875 | protected function getElementClassSelector() |
|
| 876 | { |
|
| 877 | $elementClass = $this->getElementClass(); |
|
| 878 | ||
| 879 | if (Arr::isAssoc($elementClass)) { |
|
| 880 | $classes = []; |
|
| 881 | ||
| 882 | foreach ($elementClass as $index => $class) { |
|
| 883 | $classes[$index] = '.'.(is_array($class) ? implode('.', $class) : $class); |
|
| 884 | } |
|
| 885 | ||
| 886 | return $classes; |
|
| 887 | } |
|
| 888 | ||
| 889 | return '.'.implode('.', $elementClass); |
|
| 890 | } |
|
| 891 | ||
| 892 | /** |
|
| 893 | * Add the element class. |
|