Log message #4225760

# At Username Text
# Feb 10th 2020, 01:50 challgren remove the action part if your want it to go to self
# Feb 10th 2020, 01:49 wizardfix I must be missing something here. Using (in 3.8) FormHelper to create a Form with a dropdown selector with 3 options. But when the form is submitted, the value of `$this->request->getData()` is `null`. I changed the HTTP method to `GET` , expecting the selected value to be included in the URL as a query string parameter, but the request just goes to `users/filter`.
# Feb 9th 2020, 22:53 sdevore if you have routes that specify the _namePrefix (like for API calls) and routes that don’t it seems if i use Router::url() is there a way to get the one with out the the name. I seem to always get `/api/programs/view…' vs `/programs/view...` It is mostly a cosmetic issue, but I don’t want those in the url…
# Feb 9th 2020, 20:01 phantomwatson In your controller, you can also call `$this->render(...)` with the path to the template file that you want to use. https://book.cakephp.org/3/en/controllers.html#rendering-a-view
# Feb 9th 2020, 19:20 wizardfix I worked around it by creating `search.ctp` with `$this->extend('/Results/index');` in it. :)
# Feb 9th 2020, 18:54 wizardfix v. 3.8: How do I override the default view template when rendering, so that my `search()` view function uses the `index.ctp` template instead of `search.ctp`? :thinking_face:
# Feb 9th 2020, 12:03 damiano thanks
# Feb 9th 2020, 12:03 damiano interesting @lpj145
# Feb 9th 2020, 11:42 slackebot <lpj145>
# Feb 9th 2020, 11:42 slackebot <lpj145>
# Feb 9th 2020, 11:42 slackebot <lpj145>
# Feb 9th 2020, 11:41 lpj145 is a best approachable instead of use extensions.
# Feb 9th 2020, 11:41 lpj145 @damiano why not use direct response ? instead of needed of view ?
# Feb 9th 2020, 11:35 damiano thanks @challgren!
# Feb 9th 2020, 11:35 damiano and now it works correctly
# Feb 9th 2020, 11:34 damiano i removed :?Response
# Feb 9th 2020, 11:34 damiano done! my wrong...grr, sorry, i has pagamento() :?Response { .... }
# Feb 9th 2020, 11:34 damiano waiit
# Feb 9th 2020, 11:34 damiano return $this->response;
# Feb 9th 2020, 11:33 damiano i also have tried with
# Feb 9th 2020, 11:33 slackebot $this->set('my_response',$my_results); $this->viewBuilder()->setOption('serialize', 'my_response'); }
# Feb 9th 2020, 11:33 damiano public function pagamento(): ?Response { Stripe::setApiKey(''); //debug($this->request->getData()); $my_results = ['foo'=>'bar']; $this->set('my_response',$my_results); $this->viewBuilder()->setOption('serialize', 'my_response'); //return $this->render(); return $this->response; }public function pagamento(): ?Response { $my_results = ['foo'=>'bar'];
# Feb 9th 2020, 11:33 damiano now i show my action one moment
# Feb 9th 2020, 11:33 damiano but i see no output
# Feb 9th 2020, 11:33 damiano yeah i fixed the name problem
# Feb 9th 2020, 11:32 challgren See https://gist.github.com/challgren/4aff946047b7a203805d8030cce73530
# Feb 9th 2020, 11:30 damiano no works @challgren
# Feb 9th 2020, 11:30 challgren This
# Feb 9th 2020, 11:29 damiano Notice Error: Undefined variable: routes
# Feb 9th 2020, 11:29 challgren your anonymouse callback with RouteBuilder is named something different than the books docs
# Feb 9th 2020, 11:29 damiano ops
# Feb 9th 2020, 11:29 damiano no wait if i put inside the scope i get $routes->setExtensions(['json']);
# Feb 9th 2020, 11:28 damiano ok
# Feb 9th 2020, 11:28 damiano inside
# Feb 9th 2020, 11:28 damiano pl
# Feb 9th 2020, 11:28 challgren Put it inside
# Feb 9th 2020, 11:28 damiano it is outside the scope
# Feb 9th 2020, 11:28 challgren otherwise it wont attach the routes above
# Feb 9th 2020, 11:28 damiano @challgren ^ his is my routes.php
# Feb 9th 2020, 11:28 challgren first line
# Feb 9th 2020, 11:27 challgren `$builder->setExtensions(['json']);`