2016-08-08 74 views
0

我是Wix的新手,我正在開發桌面應用程序。提取Wix對象屬性

當我創建一個新的維克斯對象:

$wix = new Wix() 

我得到這個:

object(Wix)#8 (2) { ["appId":"Wix":private]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ["secret":"Wix":private]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } 

我想提取的應用標識,並因爲它是一個私人財產,如果我嘗試訪問它,我得到這個錯誤:

Fatal error: Cannot access private property Wix::$appId 

所以,我試圖鑄造對象的數組,現在我得到這個:

array(2) { ["WixappId"]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ["Wixsecret"]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } 

但這似乎是一個奇怪的陣列,我不能訪問

誰能告訴我怎麼可以訪問此類型的數組?

謝謝

+0

什麼奇怪的有關陣列? – Steve

+0

你試過'$ wix-> getAppId()'嗎? – aynber

回答

1

我挖成維克斯SDK,並發現class object。你可以用

$wix->getAppId(); 

訪問應用程序ID如果您需要訪問的祕密,使用方法:

$wix->getSecret(); 
+0

非常感謝!這非常有幫助 –