Sunday, February 12, 2012

For getting entry script file path in Yii

If you want to return entry script file path (www directory without index.php), you can use the following code. It works great.

dirname(Yii::app()->request->scriptFile);


This results in the full directory names of the web root.
e.g. /home/example.org/www/yii/protected

http://www.yiiframework.com/forum/index.php?/topic/536-basepath-url/page__hl__scriptFile%20__fromsearch__1

The one below returns " /yii/protected/ ".

<?php echo Yii::app()->request->baseUrl; ?>

Monday, February 06, 2012

Yii CListView AJAX filtering

When I was using zii widgets CListView, I came across some problems. When I click on a different page (e.g. page 4), I would get duplicate list views.

This has been fixed specifying the id for this widget. ^___^

See the code example here:
http://www.yiiframework.com/wiki/185/clistview-ajax-filtering/