# |
Apr 28th 2017, 09:40 |
hmic |
at least the solution is quite simple... and non-braking |
# |
Apr 28th 2017, 09:39 |
hmic |
admad: there is serious security shit coming your way :p |
# |
Apr 28th 2017, 09:30 |
Sava |
Maybe I dont understand exactly how routing and request objects work but having this code https://pastebin.com/TS52yhYi in mind, shouldnt request object contain a variable named "a" with the value of "foo"? |
# |
Apr 28th 2017, 09:10 |
user83324 |
Hello. I am using CakePDF to generate PDF's in Cake 2.9. In View/pdf/mypdf.ctp I want to set the language to English (Configure::write('Config.language', 'en')) but the language does not change. I also tried Configure::write('Config.language', 'eng') without success. |
# |
Apr 28th 2017, 08:43 |
Sava |
if I debug $requestParams['lang'], in the plugin middleware, its always null no matter what |
# |
Apr 28th 2017, 08:41 |
Sava |
anyone got some experience with it? |
# |
Apr 28th 2017, 08:41 |
Sava |
hello. I need some help with ADmad's i18n plugin. Routing seems to be working, I get redirected to /lang/controller/action if I call /, but language is always set to the default language (not picked up from param in URL) |
# |
Apr 28th 2017, 04:10 |
chris-andre |
Then, inside your validationDefault(), add `$validator->email('Email')` |
# |
Apr 28th 2017, 04:09 |
chris-andre |
Inside your table class (UsersTable etc.), add beforeRules() method. Inside the method, `$entity->set($entity->name, $entity->value)` |
# |
Apr 28th 2017, 04:08 |
chris-andre |
@rrueco Ah, I think https://book.cakephp.org/3.0/en/orm/table-objects.html#beforerules is what you have to do |
# |
Apr 28th 2017, 03:52 |
bigLanky |
I need a main menu and then some of the main menu links will have child items as well that need to show on hover |
# |
Apr 28th 2017, 03:52 |
bigLanky |
using Cake 3, can anyone recommend a good menu plugin? |
# |
Apr 28th 2017, 03:36 |
rrueco |
Can't make it work :( |
# |
Apr 28th 2017, 02:49 |
hiromi2424 |
chris-andre yeah that is. thanks for completion |
# |
Apr 28th 2017, 02:48 |
rrueco |
Ok, I'll try sir. Thank you so much for the help @chris-andre , @hiromi2424 |
# |
Apr 28th 2017, 02:47 |
chris-andre |
Then you can validate `$validator->email('Email')` |
# |
Apr 28th 2017, 02:46 |
chris-andre |
In your table class beforeValidate, you can do as hiromi says, `$entity->set($entity->name, $entity->value)` |
# |
Apr 28th 2017, 02:44 |
rrueco |
I'm bit confused |
# |
Apr 28th 2017, 02:44 |
chris-andre |
Are you then thinking ->email('Email') ? |
# |
Apr 28th 2017, 02:44 |
chris-andre |
Right hiromi, that would work as well. |
# |
Apr 28th 2017, 02:43 |
hiromi2424 |
In this case perhaps notEmpty() and allowEmpty() cannot be affected since another columns are not set for each entities. |
# |
Apr 28th 2017, 02:41 |
hiromi2424 |
I think another option. before validate, $entity->set($entity->name, $entity->value); |
# |
Apr 28th 2017, 02:41 |
chris-andre |
Yes, that might be something. I never did what you are asking about, so not sure if you can use the built-in email rule. But you'll use ->add(), and maybe create your own function. |
# |
Apr 28th 2017, 02:39 |
rrueco |
I see. https://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation ? |
# |
Apr 28th 2017, 02:38 |
chris-andre |
In you table class |
# |
Apr 28th 2017, 02:38 |
rrueco |
in the controller sir? |
# |
Apr 28th 2017, 02:37 |
chris-andre |
Then you need to validate value as email when the value of name column === 'Email' |
# |
Apr 28th 2017, 02:36 |
rrueco |
The thing is I needed to validate the 'm@vc' as email in row 5 |
# |
Apr 28th 2017, 02:34 |
chris-andre |
If name has a few options, you could validate value based on name value |
# |
Apr 28th 2017, 02:30 |
chris-andre |
posted data has nothing to do with the label or the id. |
# |
Apr 28th 2017, 02:29 |
chris-andre |
why? Posted data carries the input name. |
# |
Apr 28th 2017, 02:19 |
rrueco |
is it possible to validate a field by its label? or if not, can I use id? |
# |
Apr 27th 2017, 21:54 |
siran |
hi, is there a simpler way of removing a condition from a query? please look this gist: https://gist.github.com/siran/9cf5201987b223e00c0a4c1fb7cedbb2 |
# |
Apr 27th 2017, 21:45 |
cleptric |
Yes, you can change you AppController :slightly_smiling_face: Cake updates via `composer update`will just touch the files inside the `vendor` directory |
# |
Apr 27th 2017, 21:42 |
cleptric |
cakephp/app is a repo too :slightly_smiling_face: It’s just a starting point for your application. The cakephp/cakephp repo, which is the “core” lives in your `vendor` directory |
# |
Apr 27th 2017, 21:42 |
bigLanky |
so I can directly modify this file no problem as well? |
# |
Apr 27th 2017, 21:42 |
bigLanky |
so AppController gets created for each individual project that gets created? |
# |
Apr 27th 2017, 21:41 |
bigLanky |
can check there |
# |
Apr 27th 2017, 21:41 |
bigLanky |
I guess the github would have the core files |
# |
Apr 27th 2017, 21:41 |
bigLanky |
yeah |
# |
Apr 27th 2017, 21:41 |
cleptric |
you did sth like `composer create-project cakephp/app` |