# |
Feb 9th 2018, 04:40 |
kevin |
I developed 10 apps, equaling 10million lines of code in cakephp, but that was about 7 years ago |
# |
Feb 9th 2018, 04:40 |
ricksaccous |
ex ChickensController {function editChicken($id) { debug($id); exit;}} |
# |
Feb 9th 2018, 04:40 |
kevin |
thanks |
# |
Feb 9th 2018, 04:40 |
kevin |
yeah I found it cause im dumb |
# |
Feb 9th 2018, 04:39 |
jkarlmen |
sorry about that |
# |
Feb 9th 2018, 04:39 |
ricksaccous |
the controller method action takes the parameter |
# |
Feb 9th 2018, 04:39 |
jkarlmen |
ah okay |
# |
Feb 9th 2018, 04:39 |
kevin |
@jkarlmen I think he was talkingt o me |
# |
Feb 9th 2018, 04:39 |
ricksaccous |
it's the same in cake2 and cake3 |
# |
Feb 9th 2018, 04:39 |
jkarlmen |
believe me i've searched |
# |
Feb 9th 2018, 04:39 |
kevin |
im literally trying to get a get parameter. /Users/edit/1. Im trying to get the 1. every resource I found is for cake 2 |
# |
Feb 9th 2018, 04:38 |
ricksaccous |
there are plenty of examples in the docs my friend |
# |
Feb 9th 2018, 04:38 |
kevin |
is it that they think its so easy that no one needs examples of it? |
# |
Feb 9th 2018, 04:38 |
kevin |
ugh how am I having so much trouble finding information about basic cakephp usage |
# |
Feb 9th 2018, 03:30 |
jkarlmen |
I have a question about CakeDC's user plugin I was hoping someone might be able to answer? |
# |
Feb 9th 2018, 03:29 |
jkarlmen |
Hi |
# |
Feb 9th 2018, 03:19 |
slackebot |
code that works. |
# |
Feb 9th 2018, 03:19 |
loginews |
@voycey Thanks I managed to get the data. I have apps already running in MsAccess with mysql / php at the back. MsAccess provides the front-end interface. Now converting tons of code to cakephp. Still getting used to cakephp. But that is a choice I made. It looked the best when I googled for all webdev platforms. My biggest challenge is to be able to do things without coding. I use Bake all the time. I do not want to have to rewrite php |
# |
Feb 9th 2018, 02:11 |
voycey |
@loginews Cakes ORM uses lazy loading so the queries are only executed once iterated through, if you want to see the data you can use ->toArray |
# |
Feb 9th 2018, 02:04 |
loginews |
@ricksaccous Thanks I managed to get the data. |
# |
Feb 9th 2018, 01:51 |
loginews |
I needed to execute a query, not just a find. But I used the select query to see if I got it right. |
# |
Feb 9th 2018, 01:50 |
loginews |
just not yet used to it, but I will. One thing at a time. |
# |
Feb 9th 2018, 01:49 |
ricksaccous |
it will make your life easier in the long run |
# |
Feb 9th 2018, 01:49 |
ricksaccous |
why aren't you using debugkit? |
# |
Feb 9th 2018, 01:49 |
loginews |
how to I list the results with print_r ? |
# |
Feb 9th 2018, 01:49 |
loginews |
good |
# |
Feb 9th 2018, 01:49 |
ricksaccous |
if you want objects just skip out on toArray() |
# |
Feb 9th 2018, 01:49 |
ricksaccous |
$this->Drugs->find('all')->toArray(); |
# |
Feb 9th 2018, 01:48 |
loginews |
then |
# |
Feb 9th 2018, 01:48 |
ricksaccous |
also instead of doing that why not use the find method? |
# |
Feb 9th 2018, 01:48 |
ricksaccous |
try $this->Drugs->query('select * from drugs')->toArray(); |
# |
Feb 9th 2018, 01:48 |
loginews |
how |
# |
Feb 9th 2018, 01:47 |
ricksaccous |
This is a Query object, to get the results execute it or iterate it ;) |
# |
Feb 9th 2018, 01:46 |
slackebot |
App\Model\Entity\Drug [associations] => Array ( ) [behaviors] => Array ( [0] => Search ) [defaultConnection] => default [connectionName] => default ) ) |
# |
Feb 9th 2018, 01:46 |
slackebot |
integer [Drugs.used] => integer [used] => integer [Drugs__timestamp] => timestamp [Drugs.timestamp] => timestamp [timestamp] => timestamp ) [decorators] => 0 [executed] => [hydrate] => 1 [buffered] => 1 [formatters] => 0 [mapReducers] => 0 [contain] => Array ( ) [matching] => Array ( ) [extraOptions] => Array ( ) [repository] => App\Model\Table\DrugsTable Object ( [registryAlias] => Drugs [table] => drugs [alias] => Drugs [entityClass] => |
# |
Feb 9th 2018, 01:46 |
loginews |
Cake\ORM\Query Object ( [(help)] => This is a Query object, to get the results execute or iterate it. [sql] => SELECT Drugs.id AS `Drugs__id`, Drugs.drug AS `Drugs__drug`, Drugs.used AS `Drugs__used`, Drugs.timestamp AS `Drugs__timestamp` FROM drugs Drugs [params] => Array ( ) [defaultTypes] => Array ( [Drugs__id] => integer [Drugs.id] => integer [id] => integer [Drugs__drug] => string [Drugs.drug] => string [drug] => string [Drugs__used] => |
# |
Feb 9th 2018, 01:43 |
loginews |
hold will paste it |
# |
Feb 9th 2018, 01:43 |
ricksaccous |
what is it showing instead? |
# |
Feb 9th 2018, 01:42 |
loginews |
I used that code in a controller. |
# |
Feb 9th 2018, 01:41 |
loginews |
I am surprised that print_r($data) does not show the data. Any help? |
# |
Feb 9th 2018, 01:40 |
loginews |
File uploaded https://cakesf.slack.com/files/U435V89H8/F978SAAPQ/-.txt / https://slack-files.com/T053DPNCM-F978SAAPQ-72f855ed2e |