I have a class MyData.php like this:
class myData {
function render() {
$view = new Zend_View();
$view->str = 'This is string.';
echo $view->render('myview.phtml');
}
}
and a myview.phtml file:
<div id='someid'><?= $this->str ?></div>
In another view I am doing something like this:
<?php
$obj = new myData ();
$obj->render(); // it should be <div id='someid'>This is string.</div>
?>
It is giving me following exception:
Message: no view script directory set; unable to determine location for view script
MyData.php and myview.phtml are in same directory.