I've got some trouble with upgrading my application from 1.0.1 to 1.0.5:
I have a simple URL-Rule:
in 1.0.0 - 1.0.2 I get the following result:
will be generated as new Link
Invalid argument supplied for foreach()
00115: protected function afterFind()
00119: foreach($tags as $tag)
00121: $this->tagInput=implode(', ',$tagInputs);
in 1.0.4 and 1.0.5
will be generated
I think there may be a problem with masquarading the parameter.
May be it was a bug in 1.0.1 - 1.0.3. But how do i create an URL like that?
By the way, I create the links this way:
<?php echo CHtml::link($item['label'],array('pages/show','path'=>$item['url']), array('class'=>'smnlnk')); ?>
I checked out alls tagged Yii versions. The only thing i changed between the tries was the path to the framework.
The behavior in 1.0.4 and 1.0.5 is expected because the slash '/' is url-encoded (in general, you should avoid putting slashes in GET variable names and values).
I'm not sure why 1.0.3 is causing an error. Maybe it's because of cache you enabled?
I changed no line of code or configuration. I just took another framework-version.
I try to hide the index.php to create "virtual files".
The path would look like:
I thought this is a main feature of the url rewriting.
Why should a "/" be a problem in a get-variable?
Lots of Websites uses them.
In fact I create a
before 1.0.3 it worked great.
if i configure a rule like that:
will be produced (doesn’t work).
will produce a working link like this:
I think its a Bug in the rewrite mechanism. If the parameter isn’t treatet as url-paramter key=val.it should not be urlencoded.
I couldn’t reproduce this issue. I had this rule in the test: ‘index/<param:(.*)>’=>‘site/index’
Accessing URL “/index.php/index/abc/def” shows that $_GET[‘param’]=‘abc/def’
And creating URL <?php echo $this->createUrl(‘site/index’,array(‘param’=>‘test/abc’)); ?> gives /index.php/index/test%2Fabc
Well i think, that url should not be '/index.php/index/test%2Fabc. It should be ‘/index.php/index/test/abc’.
But that seems not to be my problem. I get an apache 404, while i try to access that url. If I change the %2F to / that page will be found.
If I set the path (param in your example) to a non existing key I get my Yii-404 page. It seems, that my Yii-App isn’t called at all, if there is the %2F in the url
-> invokes my Yii-Application
-> Apache 404
I don’t know if this is a Apache problem or a Yii-Error.
I solved one part of my problem.
included to my httpd.conf solved the 404-problem.
But my url is still ugly (%2F). Is there a standard, witch forbids un encoded ‘/’ in th PATH_INFO ?