Thread: Zend Framework
View Single Post
Old 03-20-2009, 07:43 PM   #7 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

I'm using the exact copy-paste from quick guide except I added a variable to the view object.

IndexController.php
php Code:
<?php
// application/controllers/IndexController.php

/**
 * IndexController is the default controller for this application
 *
 * Notice that we do not have to require 'Zend/Controller/Action.php', this
 * is because our application is using "autoloading" in the bootstrap.
 *
 * @see [url]http://framework.zend.com/manual/en/zend.loader.html#zend.loader.load.autoload[/url]
 */

class IndexController extends Zend_Controller_Action
{
    /**
     * The "index" action is the default action for all controllers. This
     * will be the landing page of your application.
     *
     * Assuming the default route and default router, this action is dispatched
     * via the following urls:
     *   /
     *   /index/
     *   /index/index
     *
     * @return void
     */

    public function indexAction()
    {
        $this->view->text = 'Hi';
    }
}

index.phtml
php Code:
<h1 align="center">
    Hello, Zend Framework MVC!
</h1>

<?= $this->text ?>

And I've also tried it without the shorttags, thinking that was the problem, but didn't work with regular php echo style either..
__________________
Tanax is offline  
Reply With Quote