Quote
Fatal error: Cannot unset string offsets in /***/yii/web/CUrlManager.php on line 285
When I modified the CUrlManager.php file and added this line to the beginning of createAction method (of course line #285) :
echo '<pre>' . print_r($params, true) . '</pre>' . PHP_EOL;
It displays the following result:
Quote
Array
(
[id] => 1
)
7
Fatal error: Cannot unset string offsets in /***/yii/web/CUrlManager.php on line 286
(
[id] => 1
)
7
Fatal error: Cannot unset string offsets in /***/yii/web/CUrlManager.php on line 286
Here is my config/main.php (related parts) :
// enable Yii URL manager 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'caseSensitive'=>false, 'rules'=>array( // front-end 'i-Alert' => 'site/alert', 'i-Contact' => 'site/contact', 'i-Departments/<id:\d+>' => 'departments/view', 'i-Departments' => 'departments/index', 'i-Experts/<id:\d+>' => 'users/view', 'i-Experts/<start:[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]>' => 'users/index', 'i-Experts' => 'users/index', 'i-Forgot' => 'users/forgot', 'i-How' => 'site/how', 'i-Login' => 'users/login', 'i-Logout' => 'users/logout', 'i-Messages' => 'users/messages', 'i-Portfolio' => 'portfolio/index', 'i-Projects' => 'projects/index', 'i-Register' => 'users/register', 'i-Resume' => 'experts/resume', 'i-RSS' => 'site/rss', 'i-Shop/AddProduct/<id:\d+>/<token:\w+>' => 'shop/add', 'i-Shop/AddProduct/<id:\d+>' => 'shop/add', 'i-Shop/RemoveProduct/<id:\d+>/<token:\w+>' => 'shop/remove', 'i-Shop/RemoveProduct/<id:\d+>' => 'shop/remove', 'i-Shop/EmptyBasket/<token:\w+>' => 'shop/empty', 'i-Shop/EmptyBasket' => 'shop/empty', 'i-Shop/Basket' => 'shop/basket', 'i-Shop/<key:\w+>' => 'shop/index', 'i-Shop' => 'shop/index', 'i-StateCities/<id:\d+>' => 'site/cities', 'i-StateCities' => 'site/cities', 'i-Update' => 'users/update', 'i-Terms' => 'site/terms', ), ),
I searched a lot for a solution about this problem but to my surprise, nobody even reported it in Yii (in this criteria) and only three links founded and the first one is about Yii (but the problem solved and it's because of a mistake in the code) and the other two are about wordpress and drupal.
Please let me know why this problem exists and how should I solve it.
Thanks a lot.