帮助安装 Symfony 插件
你好,有人可以写或指出一个好的 symfony 插件安装教程吗?问题是,我有一个 symfony 1.2 应用程序,我正在尝试安装在 Prototype 上运行的 LightWindow 插件。
问题是:我没有安装 PEAR,并且由于代理限制,我认为我不能,但是有一种方法可以安装 symfony 插件,即将其复制到插件文件夹中,在应用程序的配置文件中启用它,然后运行 ppublish 资产,我成功完成了所有操作,但插件仍然无法运行。这是我在布局中使用的一小段代码:
<?php use_helper('LightWindow'); ?>
.
.
.
<?php foreach ( $secImages as $image ): ?>
<div class="image-slot">
<?php echo lw_image(image_tag(sfConfig::get('app_image_vo_dir') . $image->getPhoto()),
sfConfig::get('app_image_vo_dir') . $image->getPhoto()); ?>
</div>
<?php endforeach ?>
希望任何人都可以提供帮助。
另外,此代码不会直接在布局中运行,主布局使用 Ajax 包含它
[编辑]
它在非 ajax 环境中工作,但是当我尝试使用 ajax 运行它时,它不起作用,我怀疑问题出在问题是 LightWindow 脚本会检查文档上是否有就绪标签,并且由于此内容是通过 ajax 加载的,因此它看不到它!
更改为非 aJax 环境是不可能的,因为这是我的客户想要的方式,此外,2010 年没有 ajax?几乎科幻! :)
任何帮助都会很棒!
Hello can somebody write or point to a good symfony plugin installation tutorial. Here is the problem, I have a symfony 1.2 application and I'm trying to install the LightWindow plugin, which run on Prototype.
The thing is: I dont have PEAR installed, and due to proxy limitations I don't think I can, but there is a way to install symfony plugins, which is copying it in the plugins folder, enabling it in the application's config file and running plublish assets, I did all that successfuly and plugin still won't run. Here is a small piece of the code I'm using in the layout:
<?php use_helper('LightWindow'); ?>
.
.
.
<?php foreach ( $secImages as $image ): ?>
<div class="image-slot">
<?php echo lw_image(image_tag(sfConfig::get('app_image_vo_dir') . $image->getPhoto()),
sfConfig::get('app_image_vo_dir') . $image->getPhoto()); ?>
</div>
<?php endforeach ?>
Hope anybody can help.
Also this code doesn't run directly in the layout, the main layout includes it using Ajax
[EDIT]
It works in non ajax environment, but when I try to run it using ajax, it doesn't work, I suspect that the problem is that the LightWindow script checks for a tags on document ready, and since this content is loaded via ajax, it doesn't sees it!
Changing to a non aJax environment is not possible, since is the way my client wants it, besides, no ajax in 2010? almost sci-fi! :)
Any help will be terrific!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
lw_image() 帮助程序将所需的 javascript 和 css 资源添加到响应中。当您发出 ajax 请求时,这些请求将添加到 ajax 响应中。
首先浏览器无法处理它。其次,无论如何,symfony 都不会在 head 部分返回它,因为 ajax 响应没有用布局进行装饰。
要处理 javascript/css 文件,您必须将其添加到进行 ajax 调用的页面。
lw_image() helper adds required javascript and css assets to the response. As you make ajax requests those are added to the ajax response.
Firstly browsers wouldn't handle it. Secondly, it's not returned by symfony in head section anyway as ajax response is not decorated with the layout.
To process javascript/css files you have to add it to the page which makes ajax calls.