1
Yiiアプリケーションでは、1つのビュー( 'ダッシュボード')しかないので、私はこの単一のインターフェイスですべてのアプリケーションアクティビティを実行する必要があります。すべてのユーザーの詳細、アカウント、履歴、curd機能によるステータスを表示するのと同じです。どのようにYiiで複数のモデルを使用して単一のビューをwigetized?
--In Controller--
class DashboardController
{
public function actionDashboard()
{
$model = new MyDashboard;
if(isset($_POST['MyDashboard']))
{
$this->model->save();
}
$this->render('dashboard',array('model'=>$model));
}
}
-- In Dashboard View --
// userd-details
$this->widget('application.components.widgets.addGruopWidget.userdetails');
//account
$this->widget('application.components.widgets.addGruopWidget.useraccount');
//user status
$this->widget('application.components.widgets.addGruopWidget.userstatus');
//user history
$this->widget('application.components.widgets.addGruopWidget.userhistory');
DashboardControllerを使用して、この単一の「Dashboard」インターフェースですべてのカードアクティビティを定義する方法です。可能であれば、plzは解決策を提案します。ありがとう!!!
あなたが書いたことはすでに機能している可能性がありますが、ウィジェットを作成する必要はありません。 – marcovtwout
うん、その1つの場所、しかしいくつかのカード機能が正しく動作しない場合は、私たちは単一のビューから複数のデータを複数のモデルに投稿します。間違っているか構文違反になっている可能性があります。 – Frank