function onStartTag($parser, $name, $attrs) { global $currTag, $channel, $item, $image; $currTag = null; if ($name == 'RSS') { $channel = true; } elseif ($name == 'CHANNEL' && $channel) { $channel = array(); } elseif ($name == 'ITEM') { if ($item === false) { //first <ITEM> updateChannel($channel); } $item = array(); } elseif ($name == 'IMAGE') { $image = array(); } else { $currTag = strtolower($name); } }
* * @apiPermission Author of the Channel * @apiUse NotPermitted * @apiUse MissingParameter * @apiSuccessExample {json} Success-Response: * 200 OK * { * "title": "Capira Channel", * "id": "42", * "published": "1", * } * */ $app->put('/channel', function () use($app) { include_once 'libs/channel.php'; echo json_encode(updateChannel($app->request->getBody())); }); /** * * @api {PUT} /channel/parent Update a channel parent * @apiName updateChannelParent * @apiGroup Channel * @apiVersion 1.0.0 * * @apiParam {Number} id Id of the Channel * @apiParam {Number} parent New Parent of the Channel * * @apiPermission Author of the Channel * @apiUse NotPermitted * @apiUse MissingParameter * @apiSuccessExample {json} Success-Response:
public function actionSetchannel() { $data = Yii::$app->request->post(); $user = Users::find()->where(['phone' => $data['phone']])->one(); if ($user) { if ($user . updateChannel($data['channel'])) { return array('flag' => 1, 'msg' => 'update user channel success'); } else { return array('flag' => 0, 'msg' => 'update user channel fail'); } } else { return array('flag' => 0, 'msg' => 'can not find the user'); } }