Problem With Images After Adding Urlmanager

Hello,

for using a plugin i added the following code to my main.php config file:


 'urlManager' => array(

            'urlFormat' => 'path',

            'rules' => require(

                dirname(__FILE__).'/../extensions/starship/restfullyii/config/routes.php'

            ),



Afterwards none of my images showed correctly. They all had a path problem. I got most of them fixed with this code (adding the baseUrl helped):


CHtml::image(Yii::app()->request->baseUrl . '/images/mail_48.png', '');

For this code here i can’t find a solution on my own(it’s the main.php for bootstrap (the layout for my site):


<div class="span2">

                <?php

                $this->widget('bootstrap.widgets.TbMenu', array(

                    'type' => 'list',

                    'items' => array(

                        array('label' => 'My Learningapp'),

                        array('image' => Yii::app()->request->baseUrl . '/question_48.png', 'label' => 'Stacks', 'url' => array('/stack/index')),

                        array('label' => 'Export', 'url' => array('/export/index'), 'image' => 'export_16.png'),

                        array('label' => 'Developer', 'url' => array('/apiKey/index'), 'image' => 'developer_16.png'),

                        array('label' => 'Administration', 'visible' => Yii::app()->user->isAdmin),

                        array('label' => 'User management', 'url' => array('/adminuser/admin'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'users_16.png'),

                        array('label' => 'Public questions', 'url' => array('/adminquestion/admin'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'publicquestion_16.png'),

                        array('label' => 'Categories', 'url' => array('/admincategory/admin'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'categories_16.png'),

                        array('label' => 'Trashmailprovider', 'url' => array('/admintrashMailProvider/admin'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'trashmail_16.png'),

                        array('label' => 'Manage Developer', 'url' => array('/adminapiKey/admin'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'manage_dev_16.png'),

                        array('label' => 'API Settings', 'url' => array('/apiSetting/edit'), 'visible' => Yii::app()->user->isAdmin, 'image' => 'api_settings_16.png'),

                        array('label' => 'PROFILE'),

                        array('label' => 'Change password', 'url' => array('/user/changePassword'), 'image' => 'password_16.png'),

                        array('label' => 'Contact', 'url' => array('/site/contact'), 'image' => 'mail_16.png'),

                    ),

                ));

                ?>

            </div>

The image paths look like:


localhost/web_ponty/index.php/stack/images/export_16.png

The image paths should look like:


localhost/web_ponty/images/export_16.png

I get a 404 error with the message: The system is unable to find the requested action "images".

So, he always wants to call a controller fucntion instead of adding a image…

Does anyone know a solution?

Thanks in advance!

Der Regler

[color=#660066]Hi,[/color][color=#660066]what output is returned for this line ?[/color][color=#660066]Yii[/color][color=#666600]::[/color][color=#000000]app[/color]color=#666600->[/color][color=#000000]request[/color][color=#666600]->[/color][color=#000000]baseUrl[/color]

It’s


/web_ponty

And web_ponty is in my www directory of wampp.

[color=#000000] array[/color][color=#666600]([/color][color=#008800]‘image’[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#660066]Yii[/color][color=#666600]::[/color][color=#000000]app[/color]color=#666600->[/color][color=#000000]request[/color][color=#666600]->[/color][color=#000000]baseUrl [/color][color=#666600].[/color][color=#000000] [/color][color=#008800]’/question_48.png’[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]‘label’[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#008800]‘Stacks’[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]‘url’[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] array[/color]color=#666600),[/color]

Try this i hope it will help

[color=#660066]Yii[/color][color=#666600]::[/color][color=#000000]app[/color]color=#666600->[/color][color=#000000]request[/color][color=#666600]->[/color][color=#000000]baseUrl [/color][color=#666600].[/color][color=#000000] [/color][color=#008800]’/images/question_48.png’[/color]

Thanks, but this only brings another URL, that doesn’t work.