Zend框架和Ext-Js4,文件和文件夹结构 [英] Zend framework and Ext-Js4, file and folder structure
本文介绍了Zend框架和Ext-Js4,文件和文件夹结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试同时使用Zend Frame和Ext-Js4.
I am trying to use Zend Frame work and Ext-Js4 together.
但是我不知道如何正确设置文件和文件夹结构.
But I don't know how to setup file and folder structure correctly.
我这样设置,
并在 application/controllers/IndexController.php
$this->view->headScript()->appendFile('/js/ext-4.0.7/ext-all.js','text/javascript');
$this->view->headScript()->appendFile('/js/app.js','text/javascript');
$this->view->headLink()->appendStylesheet('/js/ext-4.0.7/resources/css/ext-all.css');
结构正确吗?有人有更好的主意吗?
Is it right structure? anyone has a better idea?
谢谢.
推荐答案
如果您在整个应用程序中都使用Ext-Js4,一个更好的主意是将其添加到引导程序中,这样您就不必在每个控制器中包含您的JavaScript路径.
If you're using Ext-Js4 in your entire application, a better idea would be to add this in your bootstap, so that you don't have to include your javascript paths in every controllers.
protected function _initView()
{
$view = new Zend_View();
$view->headScript()->appendFile('/js/ext-4.0.7/ext-all.js','text/javascript');
$view->headScript()->appendFile('/js/app.js','text/javascript');
$view->headLink()->appendStylesheet('/js/ext-4.0.7/resources/css/ext-all.css');
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
return $view;
}
这篇关于Zend框架和Ext-Js4,文件和文件夹结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文