雖然使用下面的代碼,但我得到這樣的錯誤 解析錯誤:在C:\ wamp \ www \ magento3 \ app \ code \ local \ Envato \ Recentproducts \ Block \ Recentproducts.php中第7行在下面的php代碼中解析錯誤
<?php
// app/code/local/Envato/Recentproducts/Block/Recentproducts.php
class Envato_Recentproducts_Block_Recentproducts extends Mage_Core_Block_Template {
public function getRecentProducts() {
// call model to fetch data
$arr_products = array();
$products = Mage::getModel("recentproducts/recentproducts")>getRecentProducts();
foreach ($products as $product) {
$arr_products[] = array(
'id' => $product->getId(),
'name' => $product>getName(),
'url' => $product>getProductUrl(),
);
}
return $arr_products;
}
}
看*真的*關閉在那一行。字符的字符。 –
仔細檢查您的代碼。看起來你有一些unicode發生在這裏或一些無法識別的字符。 –
您使用哪個編輯器進行編碼? –