Controller does not have a method named "getDirections"

Hello guys, i’m not sure if this is a bug or just a mis understanding of the API by myself.

i try to make my table headings sortable. But i get the error: Controller does not have a method named "getDirections".

be aware of the normal sort on Daytrip and the relation sort of City.

thank you in advance.


public function relations()


    return array(

        'rCity' => array(self::BELONGS_TO, 'City', 'CityId', 'alias' => 'rCity'),




<?php echo CSort::link('Daytrip'); ?>

<?php echo CSort::link('rCity.City'); ?>


public function actionList()


    $criteria = new CDbCriteria;


    $withOption = array('rCity', 'rTag');




        $criteria->condition = 'Daytrip LIKE "%' . $_GET['q'] . '%"';

        $daytripCount = Daytrip::model()->with($withOption)->count($criteria);




        $daytripCount = Daytrip::model()->with($withOption)->count($criteria);



    $sort = new CSort('Daytrip');

    $sort->defaultOrder = 'IdDaytrip ASC';


    $pages = new CPagination($daytripCount);

    $pages->pageSize = Yii::app()->params['ItemsPerPage'];


    $daytrips = Daytrip::model()->with($withOption)->findAll($criteria);

    $this->render('list', array('daytrips' => $daytrips, 'pages' => $pages));


You should call $sort->link() instead of CSort::link().