# |
Jun 11th 2018, 10:26 |
neon1024 |
If `Posts` belongs to `Categories`, there would be `$category->get('posts')` which would be an array of Post entities |
# |
Jun 11th 2018, 10:26 |
neon1024 |
@loginews Associations are a property in the Entity, either singular for singular associations and plural for plurals. |
# |
Jun 11th 2018, 10:25 |
slackebot |
!ruleone |
# |
Jun 11th 2018, 10:25 |
slackebot |
Command sent from Slack by neon1024: |
# |
Jun 11th 2018, 10:25 |
loginews |
@neon1024 You so kindly helped me with the association. I have belongsTo('subtable',['foreignKey'=>'bla', 'propertyName'=>'blabla', 'className'=>'something']). In my index.ctp I have $maintable->COL1, $maintable->COL2,.... How do I refer to something in subtable? |
# |
Jun 11th 2018, 10:22 |
lorenzo |
joomp remove the custom finder from the model definition, and do a normal find on it. Let me know if debugkit shows any warnings |
# |
Jun 11th 2018, 10:21 |
lorenzo |
joopm do you get a debugkit warning in the logs? |
# |
Jun 11th 2018, 10:15 |
joopm |
in a belongsTo association |
# |
Jun 11th 2018, 10:15 |
joopm |
i would like to use in Model's association |
# |
Jun 11th 2018, 10:14 |
adrienlambertwac |
the variable $entity is defined in your controller ? If you want to edit your $entity you can find her in your controller function and set to view form |
# |
Jun 11th 2018, 10:11 |
joopm |
make me crazy try to use in the same file but can not find |
# |
Jun 11th 2018, 10:10 |
neon1024 |
`isSuspiciouslyProduction` strikes again! ;P |
# |
Jun 11th 2018, 10:08 |
joopm |
just tried to check the debug kit, but on the error page there is no debugkit even it is allowed in the bootstrap.php |
# |
Jun 11th 2018, 10:08 |
lorenzo |
hi joopm |
# |
Jun 11th 2018, 10:05 |
joopm |
hello Lorenzo |
# |
Jun 11th 2018, 10:05 |
lorenzo |
do you see any warning in debugkit about auto tables? |
# |
Jun 11th 2018, 10:04 |
lorenzo |
maybe cake cannot find your table class? |
# |
Jun 11th 2018, 10:03 |
joopm |
gives me error Unknown finder method however the function is placed in the ModelTable |
# |
Jun 11th 2018, 10:02 |
joopm |
when i tried to use this in the model association 'finder'=>'findExternalCheck' |
# |
Jun 11th 2018, 10:02 |
joopm |
but even if i using public function findExternalCheck(...){} |
# |
Jun 11th 2018, 10:01 |
joopm |
i would like to write a custom finder method |
# |
Jun 11th 2018, 10:01 |
joopm |
have a great day to all the community members |
# |
Jun 11th 2018, 10:01 |
joopm |
hello there |
# |
Jun 11th 2018, 09:57 |
saeideng |
or at lest you should see it after `paginate()` |
# |
Jun 11th 2018, 09:55 |
saeideng |
.. in controller |
# |
Jun 11th 2018, 09:55 |
saeideng |
i'm not sure you able to see it |
# |
Jun 11th 2018, 09:54 |
saeideng |
for view `$this->paginator->current('Contents')` |
# |
Jun 11th 2018, 09:53 |
neon1024 |
Using the query works, just DebugKit being a bit misleading |
# |
Jun 11th 2018, 09:53 |
neon1024 |
Controller |
# |
Jun 11th 2018, 09:51 |
saeideng |
do you need it in view or controller .? |
# |
Jun 11th 2018, 09:49 |
saeideng |
`getQuery('page')` |
# |
Jun 11th 2018, 09:48 |
neon1024 |
:thinking_face: |
# |
Jun 11th 2018, 09:48 |
neon1024 |
So DebugKit shows the `paging` param in the Request tab, but if you dump the Request instance, it’s not there |
# |
Jun 11th 2018, 09:46 |
neon1024 |
Strangely, just `var_dump($this->getRequest()->getParam('paging'));` also returns `false` |
# |
Jun 11th 2018, 09:46 |
mukesh |
Yes |
# |
Jun 11th 2018, 09:45 |
neon1024 |
Not sure what I’m doing wrong, but this is returning false on page 2, `var_dump($this->getRequest()->getParam('paging.Contents.page'));` |
# |
Jun 11th 2018, 09:44 |
edoreld |
I read the documentation but I can't make heads or tails of it |
# |
Jun 11th 2018, 09:43 |
edoreld |
But it says 'undefined variable entity'. I am not sure what I am supposed to put there. |
# |
Jun 11th 2018, 09:43 |
edoreld |
echo $this->Form->create($entity, ['type' => 'file']); |
# |
Jun 11th 2018, 09:42 |
edoreld |
Er, rather this one |
# |
Jun 11th 2018, 09:42 |
edoreld |
echo $this->Form->create($teams, ['type' => 'file']); |