File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
components/console/helpers Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,34 @@ provide a callback function to dynamically generate suggestions::
214214 $filePath = $helper->ask($input, $output, $question);
215215 }
216216
217+ .. versionadded :: 4.3
218+
219+ The ``setAutocompleterCallback() `` method was introduced in Symfony 4.3.
220+
221+ Do not Trim the Answer
222+ ~~~~~~~~~~~~~~~~~~~~~~
223+
224+ You can also specify if you want to not trim the answer by setting it directly with
225+ :method: `Symfony\\ Component\\ Console\\ Question\\ Question::setTrimmable `::
226+
227+ use Symfony\Component\Console\Question\Question;
228+
229+ // ...
230+ public function execute(InputInterface $input, OutputInterface $output)
231+ {
232+ // ...
233+ $helper = $this->getHelper('question');
234+
235+ $question = new Question('What is the name of the child?');
236+ $question->setTrimmable(false);
237+ // if the users inputs 'elsa ' it will not be trimmed and you will get 'elsa ' as value
238+ $name = $helper->ask($input, $output, $question);
239+ }
240+
241+ .. versionadded :: 4.4
242+
243+ The ``setTrimmable() `` method was introduced in Symfony 4.4.
244+
217245Hiding the User's Response
218246~~~~~~~~~~~~~~~~~~~~~~~~~~
219247
You can’t perform that action at this time.
0 commit comments