# |
Jul 4th 2018, 13:03 |
lubos |
@pmoraes `$this->Form->control('suppressed._ids')` |
# |
Jul 4th 2018, 13:02 |
neon1024 |
You’ll need to tell Cake to use your new class, where ever that is, I guess in your Acl configuration |
# |
Jul 4th 2018, 12:30 |
pmoraes |
@lubos and your form how is it? |
# |
Jul 4th 2018, 12:02 |
mark |
alright. :) |
# |
Jul 4th 2018, 11:57 |
admad |
so will need proper check to decide when to extend |
# |
Jul 4th 2018, 11:56 |
admad |
but thats hackish and you could end up with a loop if not careful |
# |
Jul 4th 2018, 11:55 |
mark |
alright, :) let me figure that out. thank you admad! |
# |
Jul 4th 2018, 11:54 |
ldsign |
Can you have a look? |
# |
Jul 4th 2018, 11:54 |
ldsign |
namespace App\Model\Entity; use Acl\Model\Entity\Aco as ParentAco; class Aco extends ParentAco { protected $_virtual = ['text']; /** * Create virtual field "text" * * @return string text */ protected function _getText() { if (empty($this->_properties['text'])) { return $this->_properties['alias']; } return $this->_properties['text']; } } |
# |
Jul 4th 2018, 11:54 |
ldsign |
Thanks - Ive tried that but it does not work :( |
# |
Jul 4th 2018, 11:52 |
admad |
@mark you can try overring View::_evaluate() and adding the `extend()` call before `include` statement |
# |
Jul 4th 2018, 11:50 |
mark |
oops |
# |
Jul 4th 2018, 11:50 |
cliper |
hi guys, trying to sort this out quick, so im pasting into multiple support channels atm |
# |
Jul 4th 2018, 11:48 |
mark |
Hi guys, just a quick question. :) is there a way to extend a view template in AppView class? I'm looking for a solution on not repeating any code that I put in my template.ctp file that looks like this: $this->extend('../Layout/TwitterBootstrap/dashboard'); and want to move it to AppView so I could just define like, if ($this->requests->controller) are Pages, Dealers, or whatever I could just use that extend statement there.. :) |
# |
Jul 4th 2018, 11:31 |
josbeir |
$request = $this->getRequest()->withData('key', 'value'); $this->setRequest($request); $this->Crud->execute(); |
# |
Jul 4th 2018, 11:30 |
josbeir |
if you really want to manipulate request data in your controller you could just do that in your action and then call $this->Crud->execute(), havent done that myself but should work |
# |
Jul 4th 2018, 11:28 |
josbeir |
but if we are talking about marshalling, beforeMarshal will probably be fine in most cases i think |
# |
Jul 4th 2018, 11:27 |
josbeir |
not really, beforeSave can be used to perform controller logic before saving |
# |
Jul 4th 2018, 11:27 |
lubos |
but since it is in model, as you said (again correct) than this is nonsense event |
# |
Jul 4th 2018, 11:27 |
lubos |
http://crud.readthedocs.io/en/latest/events.html#crud-beforesave |
# |
Jul 4th 2018, 11:27 |
lubos |
like Crud.beforeSave |
# |
Jul 4th 2018, 11:26 |
lubos |
i meant if there is something like Crud.beforeMarshal event |
# |
Jul 4th 2018, 11:26 |
josbeir |
so that should work |
# |
Jul 4th 2018, 11:26 |
josbeir |
beforeMarshal is in the table, not controller |
# |
Jul 4th 2018, 11:25 |
lubos |
just trying to do workaround for form helper _ids which does not support joinData |
# |
Jul 4th 2018, 11:25 |
lubos |
anyone using Crud plugin, how to adjust data before marshaling? there is no such event as beforeMarshal. so I guess in edit I just do if request is put then and adjust data, right? |
# |
Jul 4th 2018, 11:24 |
lubos |
:+1: |
# |
Jul 4th 2018, 11:23 |
josbeir |
;) |
# |
Jul 4th 2018, 11:23 |
david |
thank you so much |
# |
Jul 4th 2018, 11:23 |
david |
x 60 solves it :slightly_smiling_face: |
# |
Jul 4th 2018, 11:23 |
david |
that was the problem |
# |
Jul 4th 2018, 11:22 |
josbeir |
after the browser closes that is. |
# |
Jul 4th 2018, 11:22 |
lubos |
but app.php.default comment is clear, it says minutes so @david just try to multiple ini configuration * 60, it might help |
# |
Jul 4th 2018, 11:22 |
josbeir |
anyway, on a side note, its not the best practice to persist sessions |
# |
Jul 4th 2018, 11:21 |
josbeir |
;) |
# |
Jul 4th 2018, 11:21 |
lubos |
@josbeir you are right, i just mixed minutes and seconds :slightly_smiling_face: sorry |
# |
Jul 4th 2018, 11:21 |
neon1024 |
Especially with mixed configuration |
# |
Jul 4th 2018, 11:21 |
neon1024 |
This use-case is a good highlight of your point @lubos |
# |
Jul 4th 2018, 11:20 |
josbeir |
timeout is minutes so that is correct |
# |
Jul 4th 2018, 11:20 |
lubos |
we were discussing this before, might be confusing use sometimes seconds sometimes minutes |
# |
Jul 4th 2018, 11:20 |
lubos |
rather 1440/60 for `Session.timeout` |