我想从使用set()方法设置的控制器中获取所有值。
例如:如果
this.controllerFor('application').set("one", "1");
this.controllerFor('application').set("two", "2");
this.controllerFor('application').set("three", "3");
this.controllerFor('application').set("four", "4");
那么如何直接获取所有值。我的意思是不要一个接一个地使用get()方法。
答案 0 :(得分:1)
您可以使用方法# To externally redirect /dir/foo.php?id=123&title=456 to /dir/123/456
RewriteCond %{THE_REQUEST} ^GET\s([^.]+)\.php\?id=([^&]+)&title=([^&\s]+) [NC]
RewriteRule ^ %1/%2/%3? [R,L]
# To externally redirect /dir/foo.php?id=123 to /dir/123
RewriteCond %{THE_REQUEST} ^GET\s([^.]+)\.php\?id=([^&\s]+)\s [NC]
RewriteRule ^ %1/%2? [R,L]
# To internally forward /dir/foo/12 to /dir/foo.php?id=12
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/([^/]+)(/[^/]+)?/?$ $1.php?id=$2 [L,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ video.php?id=$1&title=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ video.php?id=$1&title=$2
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^GET\s([^.]+)\.php\s [NC]
RewriteRule ^ %1 [R,L]
# To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*?)/?$ $1.php [L]
,参见示例
getProperties
参考:http://emberjs.com/api/classes/Ember.Controller.html#method_getProperties