Jump to content

nothing appears on the view :( help


sasori

Recommended Posts

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  :wtf:

 

what could possibly be wrong ?  :shrug:  :confused:

Link to comment
https://forums.phpfreaks.com/topic/204719-nothing-appears-on-the-view-help/
Share on other sites

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")));
*/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.