私は 1 つのニュース モジュールを作成しました。それは正常に動作しています..
http://domain.com/magento/news
このページはすべてのニュース項目を表示しています。タイトル、内容、日付。
ユーザーが [もっと見る] リンクをクリックすると、コンテンツの [もっと見る] リンクを作成して、ユーザーを特定のニュースサイト ページにリダイレクトする
http://domain.com/magento/news/newsitem-1
次のコードで別のコントローラーnewsitemController.phpを作成しました:
public function infoAction(){
$this->loadLayout();
$this->getLayout()->getBlock('content')
->append($this->getLayout()->createBlock('news/newsitem') );
$this->renderLayout();
}
また、以下のコードでブロック名 info.php を作成しました。
public function _prepareLayout()
{
return parent::_prepareLayout();
}
public function getnewsitem()
{
if(!$this->hasData('news')) {
$this->setData('news', Mage::registry('news'));
}
return $this->getData('news');
}
出力が得られない..
出力を得るには助けが必要です。