Retrieve value from an Array in Cakephp
-
22-09-2019 - |
문제
I am trying to get some data to display from an Array in Cakephp, the Array has all the data from a find() output and other parts of the data output fine.
The data i am trying to access is the name field inside company , the code i am using is echo $quote['Company']['name']
but it returns and error saying that the index is undefined. The code echo $quote['Status']['name']
works fine
The contents of the array looks like this
Array (
[Quote] => Array ( [id] => 3 [name] => Eighties Yeh that aint right [revision] => 1 [status_id] => 1 [contact_id] => 1 [totalcost] => 500 [created] => 2010-01-20 13:26:36 ) [Status] => Array ( [id] => 1 [name] => Open
[Quote] => Array ( [id] => 3 [name] => Eighties Yeh that aint right [revision] => 1 [status_id] => 1 [contact_id] => 1 [totalcost] => 500 [created] => 2010-01-20 13:26:36
[0] => Array ( [id] => 3 [name] => Eighties Yeh that aint right [revision] => 1 [status_id] => 1 [contact_id] => 1 [totalcost] => 500 [created] => 2010-01-20 13:26:36 )
[1] => Array ( [id] => 4 [name] => Test [revision] => 12 [status_id] => 1 [contact_id] => 1 [totalcost] => 23 [created] => 2010-01-20 19:05:36 ) ) )
[Contact] => Array ( [id] => 1 [company_id] => 1 [name] => Kieran Hutchinson [email] => kieran@redmeetsblue.com.au
[Company] => Array ( [id] => 1 [name] => Red Meets Blue )
[Quote] => Array ( [id] => 2 [name] => Test Quote 2 [revision] => 1 [status_id] => 0 [contact_id] => 1 [totalcost] => 300 [created] => 2010-01-17 10:30:31
[0] => Array ( [id] => 2 [name] => Test Quote 2 [revision] => 1 [status_id] => 0 [contact_id] => 1 [totalcost] => 300 [created] => 2010-01-17 10:30:31 )
[1] => Array ( [id] => 5 [name] => test 4 [revision] => 1 [status_id] => 3 [contact_id] => 1 [totalcost] => 233 [created] => 2010-01-20 19:05:55 )
[2] => Array ( [id] => 3 [name] => Eighties Yeh that aint right [revision] => 1 [status_id] => 1 [contact_id] => 1 [totalcost] => 500 [created] => 2010-01-20 13:26:36 ) [3] => Array ( [id] => 4 [name] => Test [revision] => 12 [status_id] => 1 [contact_id] => 1 [totalcost] => 23 [created] => 2010-01-20 19:05:36 )
[4] => Array ( [id] => 6 [name] => Test Lost Quote [revision] => 1 [status_id] => 4 [contact_id] => 1 [totalcost] => 123 [created] => 2010-01-21 16:00:43 )
[5] => Array ( [id] => 7 [name] => Test Pending QUote [revision] => 1 [status_id] => 2 [contact_id] => 1 [totalcost] => 321 [created] => 2010-01-21 16:00:57 ) ) ) [QuoteItem] => Array ( ) )
해결책
ex2jar-0.0.9.8.zip 파일을 추출하고 dex2jar-0.0.9.7과 같은 데스크탑 폴더로 이동하십시오 ... 그런 다음 Android App classes.dex 파일을 가져 와서이 디렉토리로 이동하십시오 ... 터미널을 열고 변경하십시오.dex2jar directory..type이 명령
./d2j-dex2jar.sh classes.dex
.
classesdex2.jar 파일을 가져오고 Java Decompiler를 사용 하여이 파일을 열 수 있습니다 ...
제휴하지 않습니다 StackOverflow