Widgets And Errors! Oh My!

Attached is my Form:

Files explained:

_form.php is in the gameSheet directory, and that works fine

homeandawaywidget is in gameSheet/homeandaway, not currently working (Wrong place??) [Should this be in components?? and called with application.component.directory.classname??]

_formhomeandaway.php and createhomeandaway.php based off other project work to be the ‘view’ files for my homeandawaywidget, placed in view directory under homeandaway directory. {And this above file structure just seems to be way to dumb to be the right way of doing it, any help appreciated!}

I need a little bit of help and advice from the community to get this up and running. I am working on developing a Web Application layer for a local Hockey League (Old Timer’s Hockey, so low pressure, re-creational league, but we still need to know who is winning!)

I have worked on this quite long and hard, and can’t make the leap to get Yii to help me out when the Division gets selected in a drop down (That part IS working) I then need to get that information and create a home team and away team drop down which list all the teams from ONLY the selected division.

I’ve been chipping away at this on and off for several weeks now, and I just need a little bit of guidance from some people more experienced with Yii to get me started. If anyone can just point me to some examples of a widget being used, that would help.

Thanks a bunch! Any and all help much appreciated!

Also, Error I get:

Alias "homeandaway/homeandawaywidget.php" is invalid. Make sure it points to an existing directory or file.

/Users/andresrios/Sites/POTHL/current_site/yii-admin/YiiBase.php(343)

331 unset(self::$_includePaths[$pos]);

332 }

333

334 array_unshift(self::$_includePaths,$path);

335

336 if(self::$enableIncludePath && set_include_path(’.’.PATH_SEPARATOR.implode(PATH_SEPARATOR,self::$_includePaths))===false)

337 self::$enableIncludePath=false;

338

339 return self::$_imports[$alias]=$path;

340 }

341 }

342 else

343 throw new CException(Yii::t(‘yii’,‘Alias “{alias}” is invalid. Make sure it points to an existing directory or file.’,

344 array(’{alias}’=>$alias)));

345 }

346

347 /**

348 * Translates an alias into a file path.

349 * Note, this method does not ensure the existence of the resulting file path.

350 * It only checks if the root alias is valid or not.

351 * @param string $alias alias (e.g. system.web.CController)

352 * @return mixed file path corresponding to the alias, false if the alias is invalid.

353 */

354 public static function getPathOfAlias($alias)

355 {

Stack Trace

#0

  • /Users/andresrios/Sites/POTHL/current_site/yii-admin/web/CWidgetFactory.php(147): YiiBase::import("homeandaway/homeandawaywidget.php", true)

#1

  • /Users/andresrios/Sites/POTHL/current_site/yii-admin/web/CBaseController.php(147): CWidgetFactory->createWidget(GameSheetController, "homeandaway/homeandawaywidget.php", array("division_id" => "2"))

#2

  • /Users/andresrios/Sites/POTHL/current_site/yii-admin/web/CBaseController.php(190): CBaseController->createWidget("homeandaway/homeandawaywidget.php", array("division_id" => "2"))

#3

– /Users/andresrios/Sites/POTHL/current_site/admin/protected/views/gameSheet/_form.php(115): CBaseController->beginWidget("homeandaway/homeandawaywidget.php", array("division_id" => "2"))

110 Commented out for now, no need to edit divisions during season.

111 <div class="row">

112 <?php //echo CHtml::link(‘Manage Divisions’,array(‘Division/admin’)); ?>

113 </div>

114 -->

115 <?php $this->beginWidget(‘homeandaway/homeandawaywidget.php’,array(‘division_id’=>$model->division_id)); ?>

With the offending code!!

Solved the problem on my own. I was being hopeless, hence the zero replies with so many views! Apologies. I got my views and Widgets working now, but I need to get a change on a form to update the widget’s view code (I think it would be a render partial on the embedded widget view. Any good how to’s on this topic?

Thanks!

Smaller on is view, larger one is component, this is all working in the game sheet view which I will also attach the _form.php element.

This is where I am having the trouble, it works great on updates, but when I “create” it does not refresh the component when a 'Division" has been selected? How best to accomplish this task inside the YII framework?