public function actionAliasCreate() { $alias = Inflector::slug(Yii::$app->request->post('name')); Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; if (Yii::$app->request->post('nodelimiter')) { $alias = str_replace("-", "_", $alias); } return ['alias' => $alias, 'code' => 100]; }
protected function generateSlug($slugParts) { return Inflector::slug(implode('-', $slugParts)); }
public function actionAliasCreate() { $alias = Inflector::slug(Yii::$app->request->post('name')); Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return ['alias' => $alias, 'code' => 100]; }