从自定义模型启动自定义视图。 Zend_可能吗?
你必须保证不要傻笑,但我的情况如下:
我们不想使用我们已经使用的部分和助手以及其他类似工具,而是希望在实际应用程序的所有框架和边框之外使用自定义视图。 基本上,我们此时需要根据模型的某种反应将干净的 HTML 加载到变量中。 这是猴子的事,几乎任何人都可以完成,无需使用键盘。
问题是,我们想要创建的 HTML 页面应该非常广泛,并且由于 inate“return $arrlglllgll;”而导致调试/维护/扩展的麻烦。 方法。 为了制作一个流畅且人性化的脚本,我们非常喜欢使用 .phtml 样式,将干净的 html 与 php 注入混合在一起,而无需实际渲染它。
这可能吗?如何实现?
我目前正在努力解决
$mailView = new Zend_View();
$mailView->setScriptPath('/Templates');
echo($mailView->render('test.php'));
die;
Where test.php is a file 我一直试图用任何可以想象的方式和相关性来访问它,但最终每次都失败,因为从
exception 'Zend_View_Exception' with message 'script 'test.php' not found in path (\library\Extras\Controller\Action\Helpers\)' in \library\Zend\View\Abstract.php:875
Stack trace: blablabla
控制器加载自定义视图非常简单,只需提供相对路径和你已经设置好了,但如果我在图书馆内拍摄,我似乎找不到任何东西。 有什么建议吗?
You have to promise not to giggle, but my situation is following:
Instead of using partials and helpers and other similar tools that we use already, we want to use a custom view outside all frames and borders of the actual application. Basically, we need at this point to load clean HTML into a variable upon a certain reaction a model. That is monkeys business and can be done by virtually anyone without using a keyboard.
The problem is that the HTML pages that we want to create are supposed to be quite extensive and are a trainwreck to debug/maintain/expand due to the inate "return $arrlglllgll;" approach. To make a smooth and humane script, we would very much love to use the .phtml style with clean html mixed up with php injections without actually rendering it.
Is that possible and how?
I am currently struggling with
$mailView = new Zend_View();
$mailView->setScriptPath('/Templates');
echo($mailView->render('test.php'));
die;
Where test.php is a file I have been trying to reach with any means and corelations imaginable, but ultimately failed every time due to
exception 'Zend_View_Exception' with message 'script 'test.php' not found in path (\library\Extras\Controller\Action\Helpers\)' in \library\Zend\View\Abstract.php:875
Stack trace: blablabla
Loading a custom view from a controller is butt-easy, just provide the relative path and you're set, but it seems that I cannot find anything if I shoot from within a library. Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人想知道,这比我想象的要容易得多...
因此,您可以使用 $view 作为真实视图并根据需要加载任何 $view->helper 。
要保存渲染视图,请输入...
TADAA
In case anybody wonders, this is a lot easier than I ever thought it to be...
You can thus use the $view as a real view and load any $view->helper as you please.
To save rendered view, type...
TADAA