# |
Jun 11th 2018, 17:24 |
admad |
the error message is quite clear about what needs to be done. |
# |
Jun 11th 2018, 17:23 |
developer |
and some plugins doesn't work anymore |
# |
Jun 11th 2018, 17:23 |
developer |
hehe I updated today and now I am getting "Deprecated (16384): You no longer need to call `Plugin::routes()` after upgrading to use Http\Server." |
# |
Jun 11th 2018, 17:22 |
admad |
most likely, if you state your problem |
# |
Jun 11th 2018, 17:21 |
developer |
I have a problem with the last cakephp update, someone could help me? |
# |
Jun 11th 2018, 17:20 |
developer |
Hi there! |
# |
Jun 11th 2018, 17:20 |
admad |
np |
# |
Jun 11th 2018, 17:18 |
sibusiso_slack |
Ahhh thanks. I was using `$this->request()->` instead of `$this->request->` . Thanks @lorenzo, @sdevore and @admad - I was too eager and didn't pay attention. |
# |
Jun 11th 2018, 17:16 |
admad |
can't use a method which doesn't yet exist in the version you are using :slightly_smiling_face: |
# |
Jun 11th 2018, 17:15 |
admad |
use $this->request in 3.6 |
# |
Jun 11th 2018, 17:15 |
sibusiso_slack |
@admad What can I use in 3.6? I want to hide menu items based on session variables, but I get `Call to undefinded method` whether I use `getRequest()` or the deprecated `$this->request` |
# |
Jun 11th 2018, 16:56 |
admad |
in templates too that is |
# |
Jun 11th 2018, 16:55 |
admad |
you will have `$this->getRequest()` in 3.7 :slightly_smiling_face: |
# |
Jun 11th 2018, 16:55 |
sdevore |
@sibusiso_slack I think in Views you still have to do $this->request->getSession() |
# |
Jun 11th 2018, 16:54 |
lorenzo |
`$this->request` in the view |
# |
Jun 11th 2018, 16:50 |
sibusiso_slack |
Hi Everyone, How do I access `$this->getRequest()->getSession()->check();` in views/templates? I get this error "[Error] Call to undefined method App\View\AppView::getRequest()" |
# |
Jun 11th 2018, 16:20 |
jeremyharris |
np! |
# |
Jun 11th 2018, 16:18 |
remi55 |
Thank you Jeremy ;) |
# |
Jun 11th 2018, 16:17 |
jeremyharris |
depends on the use case I guess, but I would return raw escaped data in most cases, Then they decide how to handle the multi lines. This prevents the client from having to do XSS cleaning |
# |
Jun 11th 2018, 16:17 |
remi55 |
Keeping raw data seems to be a good solution as it give more flexibility over other uses cases. |
# |
Jun 11th 2018, 16:16 |
remi55 |
Thank you. So I keep raw data and handle it in javascript with a preg_replace or something like that. |
# |
Jun 11th 2018, 16:15 |
jeremyharris |
so cleaning with `h()` and returning the multi line for the client to handle how they wish |
# |
Jun 11th 2018, 16:15 |
jeremyharris |
although usually I let the client handle how they want to display things |
# |
Jun 11th 2018, 16:13 |
jeremyharris |
is html allowed? if not, parsing it serverside would allow you to use `h()` to clean it and join with <p> or </br> after it’s cleaned |
# |
Jun 11th 2018, 16:12 |
remi55 |
Other solutions are welcome :) Your advices ? |
# |
Jun 11th 2018, 16:10 |
remi55 |
- parse it client side using a javascript func like nl2br() |
# |
Jun 11th 2018, 16:10 |
remi55 |
- parse it server side and return clean html |
# |
Jun 11th 2018, 16:10 |
remi55 |
hello everyone ! I have a json endpoint which return multiline text (\r\n chars). I need to find a great way to display it correctly in html. For the moment I have 2 solutions : |
# |
Jun 11th 2018, 16:01 |
lorenzo |
stay strong! |
# |
Jun 11th 2018, 16:00 |
neon1024 |
Off to the gym! Laters :muscle: |
# |
Jun 11th 2018, 15:59 |
birdy247 |
didnt know about it |
# |
Jun 11th 2018, 15:59 |
birdy247 |
This looks great |
# |
Jun 11th 2018, 15:59 |
birdy247 |
+1 |
# |
Jun 11th 2018, 15:59 |
neon1024 |
Do remember if you start putting lots of different returns in, you probably want a different test case |
# |
Jun 11th 2018, 15:59 |
neon1024 |
Something I find super handy when working with dates and times, as I suck with dates and times :P |
# |
Jun 11th 2018, 15:58 |
neon1024 |
Data providers are superb if you want to test the same code with different inputs |
# |
Jun 11th 2018, 15:58 |
neon1024 |
https://phpunit.de/manual/6.5/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers |
# |
Jun 11th 2018, 15:58 |
neon1024 |
Do you mean this? https://gist.github.com/davidyell/2498236846a8d71c4f84e46ff7eae483#file-testingtimewindow-php-L87 |
# |
Jun 11th 2018, 15:57 |
birdy247 |
Yes, presumably something needs to use the use the provider? |
# |
Jun 11th 2018, 15:57 |
neon1024 |
In other news, can I mix `matching` and `notMatching` in the same query? |
# |
Jun 11th 2018, 15:56 |
neon1024 |
I should edit it to make the class and test different parts of the gist, but #effort |