خرید بک لینک

Vote count: 0

In docs guides there is example:

    namespace appcontrollers;

    use yiirestActiveController;

    class UserController extends ActiveController
    {
        public $modelClass = 'appmodelsUser';
}

But i dont get it, how to work with actions.

For example:

  • DataBase has tables with many-to-many relationship (via jurinction table.

  • Сomponent to work with the models and the formation of a common response from multiple tables according to the transmitted data. Can retu an array, or an array of objects.

When use it in commands controller, it was like:

    class LastTweetsController extends Controller
    {
        /**
         * @param int $count
         *
         * @throws yiibaseInvalidConfigException
         */
        public function actionIndex($count = 10)
        {
            /** @var TweetLastfinder $tweetLastFinder */
            $tweetLastFinder = Yii::$app->get('tweetlastfinder');

            /**
             * @var TweetShow $tweetShow
             */
            $tweetShow = Yii::$app->get('tweetshow');

            // For show tweets into terminal:
$tweetShow->showLastTweetsJSON($tweetLastFinder->findLastTweets($count));
        }
    }

But how i can make same operation in ActiveController (Transmit parameter $count and retu result in JSON).

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 11 فروردين 1395 ساعت: 13:21

صفحه بندی