File tree Expand file tree Collapse file tree
src/Bridges/FormsLatte/Nodes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020/**
2121 * {form [scope|detached] name [, attributes]} ... {/form}
22- * {formContext name} ... {/formContext}
2322 * Renders form tags and initializes form context.
2423 * The `scope` keyword makes {form} skip the <form> tag emission while still pushing the
2524 * form on the stack — semantically identical to {formContext}, but with the canonical
@@ -60,6 +59,9 @@ public static function create(Tag $tag): \Generator
6059 }
6160 $ node ->attributes = $ tag ->parser ->parseArguments ();
6261 $ node ->print = $ tag ->name === 'form ' && $ node ->mode !== 'scope ' ;
62+ if (!$ node ->print ) {
63+ trigger_error ('Tag {formContext} is deprecated ' , E_USER_DEPRECATED );
64+ }
6365
6466 [$ node ->content , $ endTag ] = yield ;
6567 if ($ endTag && $ node ->name instanceof StringNode) {
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class FormPrintNode extends StatementNode
2626
2727 public static function create (Tag $ tag ): static
2828 {
29+ if ($ tag ->name === 'formPrint ' ) {
30+ trigger_error ('Tag {formPrint} is deprecated, use Nette\Forms\Blueprint::latte($form) ' , E_USER_DEPRECATED );
31+ } else {
32+ trigger_error ('Tag {formClassPrint} is deprecated, use Nette\Forms\Blueprint::dataClass($form) ' , E_USER_DEPRECATED );
33+ }
2934 $ node = new static ;
3035 $ node ->name = $ tag ->parser ->isEnd ()
3136 ? null
Original file line number Diff line number Diff line change 106106
107107< select name ="select " id ="frm-select "> < option value ="m "> male</ option > < option value ="f "> female</ option > </ select >
108108</ form >
109-
110-
111-
112-
113- < label > Sex:</ label >
114- < input type ="text " name ="username " class ="control-class " id ="frm-username ">
Original file line number Diff line number Diff line change 240240 ' ;
241241 echo $ this ->global ->forms ->renderFormEnd () /* pos %d%:1 */ ;
242242 $ this ->global ->forms ->end ();
243-
244- echo '
245-
246-
247- ' ;
248- $ this ->global ->forms ->begin ($ form = $ this ->global ->uiControl ['myForm ' ]) /* pos %d%:1 */ ;
249- echo '
250- <label ' ;
251- echo ($ ʟ_elem = $ this ->global ->forms ->item ('sex ' )->getLabelPart ())->attributes () /* pos %d%:8 */ ;
252- echo '> ' ;
253- echo $ ʟ_elem ->getHtml () /* pos %d%:8 */ ;
254- echo '</label>
255- <input ' ;
256- echo ($ ʟ_elem = $ this ->global ->forms ->item ('username ' )->getControlPart ())->attributes () /* pos %d%:8 */ ;
257- echo '>
258- ' ;
259- $ this ->global ->forms ->end ();
260243%A%
Original file line number Diff line number Diff line change 7575
7676<select n:name =" select" />
7777{ /form}
78-
79-
80- { formContext myForm}
81- <label n:name =" sex" />
82- <input n:name =username >
83- { /formContext myForm}
You can’t perform that action at this time.
0 commit comments