>
> I think you have not enabled your layout for your application.
>
> Here is how you can enable your layout:
> http://framework.zend.com/manual/en/learning.quickstart.create-layout.html
>
I don't think that's what i'm looking for. I dont want to create a differnt
layout, i just want everything to work as normal (which it does if i dont
use my own view), with only one exception - when it cant find a
view-template. see class below.
Nicolas Forgerit wrote:
>
> You probably forgot to call parent::__construct() in your deriving
> classes constructor. The parent's constructor then should fill your
> object with the expected params.
I don't have a constructor in my subclass, so the one from Zend_View is
already called.
This is what my class looks like:
class Excudo_View extends Zend_View
{
protected function _script($name)
{
try {
parent::_script($name);
} catch (Zend_View_Exception $e) {
// not found, we're gonna try the base path
if (strpos($name, "/"))
{
$parts = explode("/", $name);
$name = end($parts);
}
else
{
; // $name = $name
}
if (is_readable(APPLICATION_PATH ."/views/scripts/_base/".$name))
{
return APPLICATION_PATH ."/views/scripts/_base/".$name;
}
else
{
throw $e;
}
}
}
}
Basically, what it should do is check if the view-file exists in the
expected path and if not it should load a generic one defined in the _base
folder.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/How-to-extend-Zend-View-tp3243933p3244321.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论