|
|||
|
Hi, I just started playing with the Zend Framework and was trying out a sample in the demo video. I am using the std. tree structure for Controllers, Views and Models. I have an IndexController.php in which I have the following lines under indexAction function:
srand(); $this->view->randomNumber = rand(0,10); I have a index.phtml under the Views/Scripts/index folder but the random variable is not showing up in the View: I have the following lines in index.phtml: <h1>Hello world! </h1> <?=$this->randomNumber?> The hello world shows up correctly but the random number does not. Any help is appreciated! Thanks |
|
|||
|
I just figured out what the problem was. The sample is using short tags which are disabled by default on the windows PHP install. Once I used the long form things worked fine:
<?php echo $this->randomNumber; ?> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|