我正在使用SF 1.3.6。我有一些靜態文本文件(HTML),我希望能夠在彈出窗口中顯示。Symfony 1.3.6 - javascript popup windw - 如何?
我嘗試這樣做:
<a href="javascript:showPopup('foobar.html', 'all about foobar')">foobar</a><br />
<script type="text/javascript">
function showPopup(url, title) { window.open(url,title,"menubar=no,width=430,height=360,toolbar=no");}
</script>
我得到一個sf404Exception當我點擊的鏈接。我該如何解決這個問題?
注意:我真的不想爲這些靜態文件編寫路由,動作和模板 - 是否有另一種方式來實現彈出窗口?
[編輯]
這是我原來的.htaccess的內容。
<IfModule mod_rewrite.c>
RewriteEngine On
#force everything to www so URLs look the same
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase/
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
#redirect on trailing slash (otherwise, Symfony will 404)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=302,L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
我用Jeremy的腳本取而代之。然後我重新啓動Apache,但我得到相同的錯誤
404 |未找到| sfError404Exception 解析URL「/foobar.html」(/)後的空模塊和/或動作 。
在web文件夾的頂層是foobar.html嗎? – 2010-11-16 21:40:51
是的文件位置是這樣的:web/foobar.html – skyeagle 2010-11-16 23:07:26