Jump to content
Larry Ullman's Book Forums

smayzes

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About smayzes

  • Rank
    Newbie
  1. I should note that I beleive I figure this out. Where I do: $criteria->compare( 'instructorToken.first_name', $query, true ); I should have put: $criteria->compare( 'Users.first_name', $query, true ); Users being the model name and not the relation name. Thank you so much for the help!
  2. Hi, thanks for the link, I read through them and I did realize that my Users model did not have the HAS_MANY relationship. I added it like so: public function relations() { return array( 'lessons' => array(self::HAS_MANY, 'Lessons', 'instructor_token'), ); } I still get the error however and in brushing up on related models, I still end up stuck as what I understand from reading is that I should be able to run my criteria comparison using: $criteria->compare( 'instructorToken.first_name', $query, true ); as 'instructorToken' is the relation and as I understand
  3. Hi there, I'm a bit stuck on providing a solution for searching records in a CListView. In my code I have: LessonsController.php public function actionIndex() { $model = new Lessons('search'); // Clear any default values $model->unsetAttributes(); $this->render('index',array( 'dataProvider'=>$model->search(), 'model'=>$model )); } Lessons.php public function search() { // Get the typed query string $query = Yii::app()->request->getQuery('query'); $criteria = new CDbCriteria; // Package Name
×
×
  • Create New...