@@ -96,7 +96,7 @@ public static function generateId(string $prefix = 'id-'): string
9696 *
9797 * For example, if {@see generateInputName()} returns `Post[content]`, this method will return `post-content`.
9898 *
99- * @param string $fieldModel The field model name.
99+ * @param string $formModel The form model name.
100100 * @param string $property The property name or expression.
101101 * @param string $charset default `UTF-8`.
102102 *
@@ -106,11 +106,11 @@ public static function generateId(string $prefix = 'id-'): string
106106 * @return string the generated input ID.
107107 */
108108 public static function generateInputId (
109- string $ fieldModel = '' ,
109+ string $ formModel = '' ,
110110 string $ property = '' ,
111111 string $ charset = 'UTF-8 '
112112 ): string {
113- $ name = mb_strtolower (self ::generateInputName ($ fieldModel , $ property ), $ charset );
113+ $ name = mb_strtolower (self ::generateInputName ($ formModel , $ property ), $ charset );
114114
115115 return str_replace (['[] ' , '][ ' , '[ ' , '] ' , ' ' , '. ' ], ['' , '- ' , '- ' , '' , '- ' , '- ' ], $ name );
116116 }
@@ -127,30 +127,30 @@ public static function generateInputId(
127127 * setting the `$arrayable` parameter to `true`. For example, if the form name of the `Post` form is `Post`, then
128128 * the input name generated for the `tags[]` property would be `Post[tags][]`.
129129 *
130- * @param string $fieldModel The field model name.
130+ * @param string $formModel The form model name.
131131 * @param string $property The property name or expression.
132132 * @param bool $arrayable Whether to generate an arrayable input name. This is mainly used in tabular data input.
133133 *
134134 * @throws InvalidArgumentException If the property name contains non-word characters or empty form name for
135135 * tabular inputs
136136 */
137- public static function generateInputName (string $ fieldModel , string $ property , bool $ arrayable = false ): string
137+ public static function generateInputName (string $ formModel , string $ property , bool $ arrayable = false ): string
138138 {
139139 if ($ arrayable === true ) {
140140 $ property = self ::generateArrayableName ($ property );
141141 }
142142
143143 $ data = self ::parseProperty ($ property );
144144
145- if ($ fieldModel === '' && $ data ['prefix ' ] === '' ) {
145+ if ($ formModel === '' && $ data ['prefix ' ] === '' ) {
146146 return $ property ;
147147 }
148148
149- if ($ fieldModel !== '' ) {
150- return $ fieldModel . $ data ['prefix ' ] . '[ ' . $ data ['name ' ] . '] ' . $ data ['suffix ' ];
149+ if ($ formModel !== '' ) {
150+ return $ formModel . $ data ['prefix ' ] . '[ ' . $ data ['name ' ] . '] ' . $ data ['suffix ' ];
151151 }
152152
153- throw new InvalidArgumentException ('The field model cannot be empty for tabular inputs. ' );
153+ throw new InvalidArgumentException ('The form model name cannot be empty for tabular inputs. ' );
154154 }
155155
156156 /**
0 commit comments