Permalink
Browse files

Enhacement: 'with' param. By b3atb0x: http://www.yiiframework.com/ext…

  • Loading branch information...
1 parent 9a2c918 commit 79f09ac6843c18eb47f063d271030bbbb0883c86 @jorgebg committed Apr 3, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 SearchAction.php
View
5 SearchAction.php
@@ -36,11 +36,12 @@
*/
class SearchAction extends CAction {
- public $layout;
+ public $layout;
public $view;
public $resultView;
public $viewPath;
public $model;
+ public $with = array();
public $attributes = array('title', 'tags', 'content');
public $titleAttribute;
public $showAttributes;
@@ -108,7 +109,7 @@ public function init() {
$searched = $this->getSearched(true);
if ($searched) {
$criteria = $this->getCriteria();
- $conditions = new CDbCriteria();
+ $conditions = new CDbCriteria(array('with'=>$this->with));
foreach ($this->attributes as $attribute) {
if (strpos($attribute, '.') === false)
$attribute = ($criteria->alias ? $criteria->alias : 't') . '.' . $attribute;

0 comments on commit 79f09ac

Please sign in to comment.