# |
Jul 18th 2018, 15:22 |
flavius |
a helper is more elegant :P |
# |
Jul 18th 2018, 15:22 |
dereuromark |
back to the roots |
# |
Jul 18th 2018, 15:22 |
flavius |
i guess you could do that from the controller too :P |
# |
Jul 18th 2018, 15:21 |
flavius |
you still need a place to overwrite the default layout |
# |
Jul 18th 2018, 15:21 |
dereuromark |
cake plugins and routing/controller/frontend/assets are usually always creating a bit of hazzle |
# |
Jul 18th 2018, 15:20 |
josbeir |
$this->viewBuilder()->setClassName('TestHelper.TestHelper'); |
# |
Jul 18th 2018, 15:19 |
josbeir |
i'm not seeing the problem to just include a TestHelperView and use that in the test helper controllers |
# |
Jul 18th 2018, 15:19 |
flavius |
``` public function beforeRender(Event $event, $viewFile) { $this->getView()->setLayout('......'); } ``` |
# |
Jul 18th 2018, 15:19 |
flavius |
and in that helper you can also overwrite the layout |
# |
Jul 18th 2018, 15:19 |
flavius |
and we can load it with ``` if($this->request->getParam('plugin') == 'TestHelper') $this->loadHelper('.....'); ``` |
# |
Jul 18th 2018, 15:18 |
flavius |
you can make your custom helper in that plugin |
# |
Jul 18th 2018, 15:18 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSKJ75MH/image.png / https://slack-files.com/T053DPNCM-FBSKJ75MH-d26bdd617e - this is appview.php from the main project |
# |
Jul 18th 2018, 15:18 |
josbeir |
:) |
# |
Jul 18th 2018, 15:18 |
josbeir |
too much @dereuromark ecosphere already. |
# |
Jul 18th 2018, 15:17 |
dereuromark |
maybe you should have used the local sandbox for a test run :P less issues |
# |
Jul 18th 2018, 15:17 |
flavius |
the way i did it was like this |
# |
Jul 18th 2018, 15:17 |
dereuromark |
easy to fix then, yeah. for now it can be in $helpers in controllers |
# |
Jul 18th 2018, 15:17 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSG8LUCC/image.png / https://slack-files.com/T053DPNCM-FBSG8LUCC-3a96800596 - there's also this that <@UAG1HNWKT> mentioned |
# |
Jul 18th 2018, 15:16 |
dereuromark |
lets make testing great again |
# |
Jul 18th 2018, 15:15 |
josbeir |
yeah saw that one too, i didn't agree so no mention :) |
# |
Jul 18th 2018, 15:15 |
flavius |
point stands, i have one fine body at least :P |
# |
Jul 18th 2018, 15:14 |
dereuromark |
agreed |
# |
Jul 18th 2018, 15:14 |
josbeir |
i think a proper default theme would be the best aproach for this plugin |
# |
Jul 18th 2018, 15:14 |
dereuromark |
bundling frontend and assets into php stuff is not that easy |
# |
Jul 18th 2018, 15:14 |
dereuromark |
sry, did only test with the apps that seem to have those built in |
# |
Jul 18th 2018, 15:13 |
dereuromark |
yeah I guess those are pulled in the main layout assets. |
# |
Jul 18th 2018, 15:13 |
flavius |
well you didn't include any of that in your plugin |
# |
Jul 18th 2018, 15:12 |
dereuromark |
seems also to miss some styling for the overlay window that runs the ajax for executing the test and displaying result |
# |
Jul 18th 2018, 15:11 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSKC7W75/image.png / https://slack-files.com/T053DPNCM-FBSKC7W75-af970fb2e0 - <@U052SF4V6> not really sure how this is supposed to work |
# |
Jul 18th 2018, 14:58 |
josbeir |
so best do do it below after the save stuff |
# |
Jul 18th 2018, 14:58 |
josbeir |
yep but rules not |
# |
Jul 18th 2018, 14:57 |
neon1024 |
Entity errors will be present after patchEntity ;) |
# |
Jul 18th 2018, 14:56 |
josbeir |
also check the Email entity's $accessible array if all fields you want to save are defined there (if the property is present) |
# |
Jul 18th 2018, 14:55 |
josbeir |
see whats inside that array |
# |
Jul 18th 2018, 14:55 |
josbeir |
and save |
# |
Jul 18th 2018, 14:55 |
josbeir |
do a $email->getErrors(); |
# |
Jul 18th 2018, 14:55 |
mr.mjsm |
$email = $this->Emails->patchEntity($email, ['email' => $this->request->getData('email'), 'is_primary' => 'true', 'company_id' => $company->company_id ]); |
# |
Jul 18th 2018, 14:55 |
mr.mjsm |
i am thinking my assignment here is wrong |
# |
Jul 18th 2018, 14:55 |
josbeir |
above the $this->set below |
# |
Jul 18th 2018, 14:54 |
josbeir |
validation and/or rules are probably failing |
# |
Jul 18th 2018, 14:54 |
mr.mjsm |
$this->Emails->save($email) results in FALSE |