I've downloaded Portlet and Login portlets and put them to the extension dir.
Then in the main layout I wrote:
<?php $this->widget('application.extensions.login.XLoginPortlet',array( 'visible'=>Yii::app()->user->isGuest, )); ?>
It showed me CException page:
00122: /** 00123: * Getter magic method. 00124: * This method is overridden to support accessing application components 00125: * like reading application properties. 00126: * @param string application component or property name 00127: * @return mixed the named property value 00128: */ 00129: public function __get($name) 00130: { 00131: if($this->hasComponent($name)) 00132: return $this->getComponent($name); 00133: else 00134: return parent::__get($name); 00135: } 00136: 00137: /** 00138: * Runs the application. 00139: * This method loads static application components. Derived classes usually overrides this 00140: * method to do more application-specific tasks. 00141: * Remember to call the parent implementation so that static application components are loaded. 00142: */ 00143: public function run() 00144: { 00145: $this->onbeginRequest(new CEvent($this)); 00146: $this->processRequest();
Stack:
#0 /usr/home/konstantin/TVSMedia/EveryStyle/framework/base/CApplication.php(134): CComponent->__get('clientScript') #1 /usr/home/konstantin/TVSMedia/EveryStyle/testdrive/protected/extensions/portlet/XPortlet.php(62): CApplication->__get('clientScript') #2 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CBaseController.php(141): XPortlet->init() #3 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CBaseController.php(152): CBaseController->createWidget('application.ext...', Array) #4 /usr/home/konstantin/TVSMedia/EveryStyle/testdrive/protected/views/layouts/main.php(26): CBaseController->widget('application.ext...', Array) #5 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CBaseController.php(119): require('/usr/home/konst...') #6 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CBaseController.php(88): CBaseController->renderInternal('/usr/home/konst...', Array, true) #7 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CController.php(420): CBaseController->renderFile('/usr/home/konst...', Array, true) #8 /usr/home/konstantin/TVSMedia/EveryStyle/testdrive/protected/controllers/SiteController.php(27): CController->render('index') #9 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/actions/CInlineAction.php(32): SiteController->actionIndex() #10 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CController.php(207): CInlineAction->run() #11 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CController.php(192): CController->runAction(Object(CInlineAction)) #12 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CController.php(167): CController->runActionWithFilters(Object(CInlineAction), Array) #13 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CWebApplication.php(146): CController->run('index') #14 /usr/home/konstantin/TVSMedia/EveryStyle/framework/web/CWebApplication.php(118): CWebApplication->runController('site', 'index') #15 /usr/home/konstantin/TVSMedia/EveryStyle/framework/base/CApplication.php(146): CWebApplication->processRequest() #16 /usr/home/konstantin/TVSMedia/EveryStyle/testdrive/index.php(11): CApplication->run() #17 {main}
I searched the forum and found thread where there were problems with clientScript also. There Qiang recommended upgrading to the latest SVN. I configured SVN on my server and checked out latest revision, here is version of the CApplication:
@version $Id: CApplication.php 314 2008-12-01 18:32:23Z qiang.xue $
What's the problem with it? Maybe I'm missing some configs? I re-read article about extending Yii, about creation widget, but didn't see anything about extra config there.
What I'm doing wrong?