Log message #4225750

# At Username Text
# 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']);`
# Feb 9th 2020, 11:27 challgren no inside your scope
# Feb 9th 2020, 11:27 slackebot 'payment']);` `$builder->fallbacks();` `});`
# Feb 9th 2020, 11:27 damiano `$routes->setRouteClass(DashedRoute::class);` `$routes->setExtensions(['json']);` `$routes->scope('/', function (RouteBuilder $builder) {` `$builder->connect('/*', ['controller' => 'Pages',], ['_name' => 'home']);` `$builder->connect('/prenota/*', ['controller' => 'Pages', 'action' => 'prenota'], ['_name' => 'book']);` `$builder->connect('/pagamento', ['controller' => 'Pages', 'action' => 'pagamento'], ['_name' =>
# Feb 9th 2020, 11:25 challgren `$routes->setExtensions(['json']);`
# Feb 9th 2020, 11:25 challgren Do this instead https://book.cakephp.org/4/en/development/routing.html#file-extensions
# Feb 9th 2020, 11:24 damiano hmm
# Feb 9th 2020, 11:24 damiano /pagamento.json
# Feb 9th 2020, 11:24 challgren no
# Feb 9th 2020, 11:24 damiano should i add .json over there too ?
# Feb 9th 2020, 11:24 damiano $builder->connect('/pagamento', ['controller' => 'Pages', 'action' => 'pagamento'], ['_name' => 'payment']);