私はZend Framework Appを開発中です。それは追加のアクションに行っていないので、私のフォームは表示されません
私indexcontrollerビュービュー/スクリプトで/インデックス/ index.phtmlを
<p><a href="<?php echo $this->url(array('controller'=>'index',
'action'=>'add'));?>">Add new album</a></p>
私のブラウザでは私だけでURLパスを出力していますさ。 は、ここでは、
public function addAction()
{
// action body
$form = new Application_Form_User();
$form->submit->setLabel('Add');
$this->view->form = $form;
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
$artist = $form->getValue('artist');
$title = $form->getValue('title');
$albums = new Application_Model_DbTable_Albums();
$albums->addUser($artist, $title);
$this->_helper->redirector('index');
} else {
$form->populate($formData);
}
}
}
IndexController.php
の私の追加アクションであり、アクションを追加するつもりはない、なぜ私のadd.phtmlは<?php
$this->title = "Add new album";
$this->headTitle($this->title);
echo $this->form ;
?>
です。提案してください 編集詳細
と私は9 が、私はこの行を置くために得ていないのですページ番号でアプリhttp://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf
を構築するために、このPDFファイルを使用して、これらの線は必要であるかそうでないのです?
$view = new Zend_View();
$view->setScriptPath('/path/to/scripts');
echo $view->render('script.php');
と私はレイアウトやCSSを設定していない.butデータベースからの私のリストが来ているが、私のアドオンDctionが動作していませんか?理由を提案してください
あなたがこれを持って、フォームを見てみたいん:
は、この(私はそれがデフォルトルートだと仮定)のように、あなたのビューヘルパーにルート名を定義してみ?
Add new album
–カスタムルートが追加されましたか? – akond
@akondまだまだ手に入れられていないかもしれない – XMen