sasori Posted June 14, 2010 Share Posted June 14, 2010 here's my controller ArtistController.php <?php class ArtistController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { // action body } public function listAllArtistsAction() { // action body } public function artistsAffiliateContentAction() { } public function profileAction() { } public function newAction() { $genres = array( "Electronic", "Country", "Rock", "R & B", "Hip Hop", "Heavey-Metal", "Alternative Rock", "Christian", "Jazz", "Pop" ); $this->view->genres = $genres; } } heres my view new.phtml <?php echo $this->doctype('XHTML1_STRICT');?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <?php echo $this->headTitle('LoudBite.com - Add Artist'); ?> </head> <body> <?php echo $this->render('includes/header.phtml'); ?> <h2>Add Artist</h2> <form method="post" action="save-artist"> <table width="500" border="0" cellpadding="5"> <tr> <td>Artist Name:</td> <td><input type="text" name="artistName" /></td> </tr> <tr> <td>Genre</td> <td> <select name="genre"> <?php foreach($this->genres as $genre){?> <option value="<?php echo $genre; ?>"><?php echo $genre; ?></option> <?php}?> </select> </td></tr> <tr> <td>Add to Favorite List</td> <td>Yes <input type="radio" value="yes" name="isFav" /> | No <input type="radio" value="no" name="isFav" /> </td> </tr> <tr> <td>Rate:</td> <td>1 <input type="radio" name="rating" value="1" />| 2 <input type="radio" name="rating" value="2" />| 3 <input type="radio" name="rating" value="3" />| 4 <input type="radio" name="rating" value="4" />| 5 <input type="radio" name="rating" value="5" /></td> </tr> <tr> <td colspan="2"><input type="submit" value="Add Artist" /></td> </tr> </table> </form> </body> </html> when i call http://zf/myapp/public/artist/new it's a blank page what could possibly be wrong ? Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/ Share on other sites More sharing options...
ignace Posted June 14, 2010 Share Posted June 14, 2010 Did you setup Layout to work with MVC? Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/#findComment-1071799 Share on other sites More sharing options...
sasori Posted June 14, 2010 Author Share Posted June 14, 2010 Did you setup Layout to work with MVC? what do you mean? as far as I can understand, I started building the controllers using Zend_Tool Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/#findComment-1071803 Share on other sites More sharing options...
sasori Posted June 14, 2010 Author Share Posted June 14, 2010 case solved, i removed this extra url router /* $Router->addRoute("artistprofile", new Zend_Controller_Router_Route( "artist/:artistname", array( "artistname"=>"The Smiths", "controller"=>"artist", "action"=>"profile"))); */ Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/#findComment-1071813 Share on other sites More sharing options...
ignace Posted June 14, 2010 Share Posted June 14, 2010 Commenting out "artistname"=>"The Smiths" would have sufficed. Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/#findComment-1071907 Share on other sites More sharing options...
sasori Posted June 14, 2010 Author Share Posted June 14, 2010 ok thanks..noted Quote Link to comment https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/#findComment-1071909 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.