Yii Framework Forum: Make CClientScript::renderHead() as public function - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Make CClientScript::renderHead() as public function Rate Topic: -----

#1 User is offline   tyohan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 08-October 08
  • Location:Bandung, Indonesia

Posted 12 December 2008 - 09:35 AM

I need to set meta tag on my application. So I need to set meta tag from my page controller. I tried to use CClientScript::renderHead() but it's a protected function so I can't call it direct from Controller class.

My question, Is there any other method to set my head tag on output method? Or it's need to modify the renderHead function to public function?
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 12 December 2008 - 09:42 AM

I don't think it's appropriate to make renderHead as public.
Instead, we should provide support for adding meta tags. Could you please create a ticket for this?
0

#3 User is offline   tyohan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 08-October 08
  • Location:Bandung, Indonesia

Posted 12 December 2008 - 10:13 AM

Ticket created on http://code.google.c...es/detail?id=55

Thanks
0

#4 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 12 December 2008 - 02:21 PM

Also, registerLink could be useful :)
0

#5 User is offline   logicoder 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 09-December 08
  • Location:Milan, Italy

Posted 15 December 2008 - 11:09 AM

Personally I like the ZF Placeholder Helper implementation for Doctype, HeadLink, HeadMeta, HeadScript, HeadStyle, HeadTitle, InlineScript.

see http://framework.zen...ew.helpers.html
0

#6 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 15 December 2008 - 11:41 AM

Thank you for the pointer. I will take a look and see if we can implement similar feature.
You may also take a look the "clip" feature in Yii, which implements similar placeholder feature. Check CBaseController::beginClip.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users