|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Custom view helper and auto detecting directoryHi,
This is probably
more of a PHP than ZF question, but I am hoping some can help
:-)
I have a custom view
helper class for widgets that live outside the MVC structure
i.e.
htdocs
application
controllers
models
views
...
library
Magik
View
Helper
WidgetMessage.php
View.php
...
widgets MyWidget
MyWidget.php
MyWidget.phtml
<code>
class Magik_View extends Zend_View { public function __construct($path = null) { $this->addHelperPath('library' . DS . 'Magik' . DS . 'View' . DS . 'Helper' , 'Magik_View_Helper');
$this->setScriptPath($path); } As you can see in the above code I have to pass a path when I call the class within my file MyWidget.php e.g. $view = new Magik_View(dirname(__FILE__)); What I would like to be able to do is just use: $view = new Magik_View(); So, my question is, is there anyway for my custom view helpler to be able to automatically detect the directory that MyWidget.php is living in? Thanks in advance, - Robert ________________________________________________________________________ This email has been scanned for all known viruses by the MessageLabs Email Security Service and the Macro 4 plc internal virus protection system. ________________________________________________________________________ |
|
|
|
| Free Forum Powered by Nabble | Forum Help |