best way to pass form values
- jdan1131x
- Member | 41
Nette always has interesting ways to do things
that i dont know yet, so thought i would ask..
I know i can pass form values from step1presenter
to step2 presenter with:
A>
code above in step 2 constructor…
or
B>
above code in step 2…
or
C>
code above in step 1 and then capture with A> or B> above
or (i think…)
D>
But given I dont want to store the data in db or file until step 4 or
5…
I think Step A and C are simplest way. But Step D and B seem good too.
or maybe something even more optimal is available? I really want to
standardize
how i pass data from presenter to presenter…
thanks for any input…
James
Last edited by jdan1131x (2021-05-01 19:17)
- jdan1131x
- Member | 41
thanks vm,
its too early in the dev cycle for nice forms like you mention.
but eventually…
step 1 form is simple and is working fine…
i am only working on path 1 (simple option) then step two in this path
will
query user for presentation method (upload or create simple html), then …
put into a distribution queue, then deliver via X.
moderate/advanced/smart paths 2–4 will require more…
as you can see in the form, i plan to let them store their selections
in their preferences too…
Thanks
James
- dsar
- Backer | 53
its too early in the dev cycle for nice forms like you mention.
In my opinion your multi-step form could be done with just one form, but look at this:
- jdan1131x
- Member | 41
Hey Dsar,
yes, thats very nice. agreed. will give it a try after i
understand the less elegant way…
I also like this piece:
as it will help me simplify my constructors a lot…
thanks again, you confirmed what i thought, that
there is another nice way…i didnt see that package in
componnette…
regards,
James
- jdan1131x
- Member | 41
i cannot seem to pass a simple query to a presenter constructor
i setup TestingPresenter as follows
i set up the default.latte for Testing:
the latte prints only my name, and not the $data string.
I tried these links in another Presenter with out success
and
and
with the code being:
i can see this → mydomain/testing/?data=test in the browser but
the word “test” is not being displayed in the Testing template.
I am sorry to ask for help on something seems so simple,
but have tried many diff ways…no success
James
- jdan1131x
- Member | 41
well, solved it. went jogging
came back, decided the post data was prob
going to renderDefault(), not __constructor(),
so did this:
and all is working fine. erased constructor. now i can
move on to walking the dog :-)
thanks much always, nette is awesome. a little
like climbing K2, at first :-)
James
- dkorpar
- Member | 136
You can't pass post variables to presenter constructor, it's wrong on many different levels…
Looks to me like you're missing some basic DI knowledge, see here: https://doc.nette.org/…introduction
- jdan1131x
- Member | 41
thanks very much, yes i am still unlearning my old skills where i would
instantiate objects inside classes
and pass all sorts of vars to the constructor…
i did find it passes arrays to renderDefault() …
i will learn… just have to practice, read,code,rinse and repeat.
regards,
James
- LilliBoisse
- Member | 1
I am agree with your answer my problem is solved. I am very happy 👍
Have a nice day to all the members 😇