${requestScope['javax.servlet.forward.servlet_path']} 得到正确的字符串,但不包括可能在网址中设置的参数.
例:
http://localhost/path/i/want?param=1 应该给我一个字符串 /path/i/want?param=1
我有一种感觉,这应该很容易做到,但无法弄清楚.
提前致谢!
假设我有一系列对象
[{href: 'some_uri', 'class': 'this-css-class'}, {href: 'another_uri', 'class': 'that-css-class'}]
我现在想将其映射到html列表:
<ul>
<li class="this-css-class"><a href="some_uri">some_uri</a></li>
<li class="that-css-class"><a href="another_uri">another_uri</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
假设我向我的数组中添加了另一个对象,我想<li>在列表中添加一个新对象.相反,当我$('.that-css-class').remove()列出其中一个列表项时,我希望它也可以在数组中消失.
我想把它保存在jQuery中,因为我不想在项目中引入另一个框架.
非常感谢,这一直在我的脑海中.谢谢.
我一直在努力.希望你们能帮忙.我无法找出错误所在.
的httpd-vhosts.conf
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot /opt/lampp/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot /home/tilman/Sites/mysite/www
ServerName mysite.lo
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
/ etc/hosts文件
127.0.0.1 localhost
127.0.0.1 mysite.lo
Run Code Online (Sandbox Code Playgroud)
config.php文件
$config['base_url'] = "http://mysite.lo";
$config['index_page'] = "";
Run Code Online (Sandbox Code Playgroud)
WWW /的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
Run Code Online (Sandbox Code Playgroud)
现在http://mysite.lo向我展示默认控制器.http://mysite.lo/index.php同样.那样做http://mysite.lo/index.php/welcome.
但http://mysite.lo/welcome事实并非如此.
http://localhost/mysite/www/welcome 按预期工作.
编辑:我想将系统和应用程序移出Web根目录.所以我的文件结构如下:
application/
system/
www/
'- index.php
Run Code Online (Sandbox Code Playgroud)
在index.php中,我当然改变了系统和应用程序文件夹的路径.
$array = array(
'first element',
'second element',
'third element',
);
echo $array['1'];
echo $array[1];
Run Code Online (Sandbox Code Playgroud)
它们都产生相同的结果.
我问这个问题,因为我注意到例如drupal访问索引作为字符串文字,其中php.net使用整数.
一个优于另一个吗?
我当然知道为什么$array[foo]不好.