overriding CClientScript::renderHead() fail

i think this is a bug !! so i report it.

(just like what i wrote in the issue at google codes)

the problem appear when overriding CClientScript::renderHead()

What steps will reproduce the problem?

1.make new project (yiic webapp myapp)

2.create new component inside:


with the code:


class MyClientScript extends CClientScript {

	public function renderHead(&$output)


        $output="Hello world";



  1. add new component into components array inside


// application components






  1. navigate into:

http://localhost/mya...hp?r=site/index then into http://localhost/mya…?r=site/contact

What is the expected output? What do you see instead?

"Hello world" in entire site.

in index and about (static pages) the MyClientScript component doesn’t execute at all…it should render the header for entire website from ‘class’=>‘MyClientScript’

What version of the product are you using? On what operating system?

  • Yii 1.1.7

  • ubuntu natty

  • firefox 4 and chrome.

Note: i attached my project for testing.

I can’t see anything wrong - actually i extended CClientScript myself and it works just fine. So it’s not a Yii bug - You must have a typo or a tiny misconfiguration somewhere. Maybe try some more debugging (add log output, log some debug messages, …).

thanks Mike for replying :rolleyes:

yes you are right, it is invalid issue and not a bug

and here is the issue link : http://code.google.c.../detail?id=2457

i was looking for the main renderer method if there is no scripts to register !! <<< what i was thinking about !! Lol

((@Muaid: go find a brain for your self :P))

if there is no scripts to register it is simply will render the main layout file.

Yii simplicity will drive me crazy sometimes and confuses me …

thanks all and sorry for wasting your time.