Skip to content

Instantly share code, notes, and snippets.

@muya
Last active December 17, 2015 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muya/5655242 to your computer and use it in GitHub Desktop.
Save muya/5655242 to your computer and use it in GitHub Desktop.
Snippet for Yii's actionAdmin function in the Controller class
/**
* UsersController actionAdmin function
*/
public function actionAdmin() {
$model = new Users('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Users']))
$model->attributes = $_GET['Users'];
$this->render('admin', array(
'model' => $model,
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment