# |
Dec 15th 2017, 17:05 |
rafael.junqueira.sant |
thank you very much! |
# |
Dec 15th 2017, 17:04 |
dereuromark |
@admad Would you mind reopening with the new info collected? Sounds like a core issue with the session structure to be changed in a few this helper feature doesnt work anymore. |
# |
Dec 15th 2017, 17:02 |
rafael.junqueira.sant |
I would like to rely on plugins only if really necessary, and seek to fix unexpected behaviors in the core. |
# |
Dec 15th 2017, 17:01 |
rafael.junqueira.sant |
either the problem is in the documentation, or in the code. maybe there is something I missing, but then the documentation isn't any clear for me. |
# |
Dec 15th 2017, 17:01 |
rafael.junqueira.sant |
if I continue the ticket, I think it will be disturbing to him. |
# |
Dec 15th 2017, 17:00 |
rafael.junqueira.sant |
it seems you understood what happened. can you tell admad in the ticket? maybe he'll understand you more clearly |
# |
Dec 15th 2017, 16:59 |
dereuromark |
I remember that there were changes around stacked messages and thus a now nested structure.. (sth I have been using for 10 years now using my own Flash plugin, thus I wouldnt know what happened in core) |
# |
Dec 15th 2017, 16:59 |
dereuromark |
dd($_SESSION) etc |
# |
Dec 15th 2017, 16:58 |
rafael.junqueira.sant |
how do I do it? |
# |
Dec 15th 2017, 16:58 |
dereuromark |
Maybe the test session structure is not the real one anymore (you can check that by comparing to your own) |
# |
Dec 15th 2017, 16:58 |
dereuromark |
Strange, there is a test: https://github.com/cakephp/cakephp/blob/master/tests/TestCase/View/Helper/FlashHelperTest.php#L181 |
# |
Dec 15th 2017, 16:57 |
rafael.junqueira.sant |
it works, but I was trying to understand the expected behavior in the default functionality. |
# |
Dec 15th 2017, 16:57 |
rafael.junqueira.sant |
what I did didn't please me: in the Flash component, instead of setting the element as success, I set the key as success and rendered it in the element. |
# |
Dec 15th 2017, 16:56 |
rafael.junqueira.sant |
good. I just want to find a clean solution |
# |
Dec 15th 2017, 16:55 |
dereuromark |
I suspect that the merging changed, and thus doesnt work anymore |
# |
Dec 15th 2017, 16:55 |
dereuromark |
its important to always post the data of your session structure in "flash" key, also the result in your template. otherwise it is impossible to help here. |
# |
Dec 15th 2017, 16:54 |
dereuromark |
thats how the code can be read: $message = $options + $message; |
# |
Dec 15th 2017, 16:54 |
rafael.junqueira.sant |
Notice (8): Undefined variable: message [APP/Template\Element\Flash\success.ctp, line 3] |
# |
Dec 15th 2017, 16:54 |
rafael.junqueira.sant |
this is the error I still receive: |
# |
Dec 15th 2017, 16:54 |
dereuromark |
yeah they should all be using that element then |
# |
Dec 15th 2017, 16:54 |
rafael.junqueira.sant |
we are people from different nationalities and mindsets, it is hard to predict sometimes how the other person will understand all these letters I'm typing, specially with a big chunk of information without feedback. |
# |
Dec 15th 2017, 16:52 |
rafael.junqueira.sant |
with 'success' and another one in 'error' |
# |
Dec 15th 2017, 16:52 |
dereuromark |
you havent specified any of tht in your ticket, you were only talking about scoping and order |
# |
Dec 15th 2017, 16:52 |
rafael.junqueira.sant |
so, I go to my AppView.php and place the renderer: $this->Flash->render('flash', [ 'element' => 'success' ]); |
# |
Dec 15th 2017, 16:51 |
dereuromark |
so even that you created great_success.ctp it does not use it? |
# |
Dec 15th 2017, 16:51 |
rafael.junqueira.sant |
yes, separate div containers, that's all I want. |
# |
Dec 15th 2017, 16:51 |
dereuromark |
separate div containers, not completely separate |
# |
Dec 15th 2017, 16:51 |
rafael.junqueira.sant |
"// In your View: Will use great_success.ctp instead of succcess.ctp <?= $this->Flash->render('flash', [ 'element' => 'great_success' ]);" |
# |
Dec 15th 2017, 16:51 |
dereuromark |
that is all the core provides. all working exactly like this. |
# |
Dec 15th 2017, 16:50 |
rafael.junqueira.sant |
This is what the documentation says: |
# |
Dec 15th 2017, 16:50 |
rafael.junqueira.sant |
but it is not done automatically, there is something that must be done. |
# |
Dec 15th 2017, 16:50 |
rafael.junqueira.sant |
so, it is done so to render the messages in the Flash/success.ctp and Flash/error.ctp, separately |
# |
Dec 15th 2017, 16:49 |
rafael.junqueira.sant |
good, as I saw in the Flash component class, it sets 'success' and 'error' to the 'element' option in Flash with a magic method |
# |
Dec 15th 2017, 16:48 |
rafael.junqueira.sant |
by default, when I use bake, it creates controllers that sets flash messages with $this->Flash->success(__('The example has been saved.')), and $this->Flash->error(__('The example could not be saved. Please, try again.')) |
# |
Dec 15th 2017, 16:46 |
rafael.junqueira.sant |
let's try to understand this, look |
# |
Dec 15th 2017, 16:46 |
rafael.junqueira.sant |
yes |
# |
Dec 15th 2017, 16:46 |
dereuromark |
I dont understand |
# |
Dec 15th 2017, 16:46 |
rafael.junqueira.sant |
Please, just ty to understand my point: how to render Flash->success and ...->error in the elements? |
# |
Dec 15th 2017, 16:45 |
rafael.junqueira.sant |
I consider the possibility that I am missing something, but what am I missing? |
# |
Dec 15th 2017, 16:45 |
dereuromark |
Then build your own Flash helper at least :slightly_smiling_face: |
# |
Dec 15th 2017, 16:45 |
rafael.junqueira.sant |
I know I could use the plugin, but since it gives me $this->Flash->success and ...->error and elements by default, why should I use a plugin for this situation? |