本文整理汇总了PHP中StringHelper::filterArrayString方法的典型用法代码示例。如果您正苦于以下问题:PHP StringHelper::filterArrayString方法的具体用法?PHP StringHelper::filterArrayString怎么用?PHP StringHelper::filterArrayString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHelper
的用法示例。
在下文中一共展示了StringHelper::filterArrayString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEditProcess
public function actionEditProcess()
{
try {
$post = StringHelper::filterArrayString($_POST);
$path = null;
if (isset($_FILES['file'])) {
$path = UploadHelper::getUrlUploadSingleImage($_FILES['file'], 'file');
}
$result = Document::model()->edit($_POST, $path);
if ($result == 1) {
Yii::app()->user->setFlash('success', 'Cập nhật dữ liệu thành công !');
$this->redirect(Yii::app()->createUrl('document/edit', array('id' => $post['id'])));
} else {
if ($result == 2) {
Yii::app()->user->setFlash('error', 'Cập nhật dữ liệu thất bại !');
$this->redirect(Yii::app()->createUrl('document/edit', array('id' => $post['id'])));
} else {
Yii::app()->user->setFlash('error', 'Không tồn tại tài liệu !');
$this->redirect(Yii::app()->createUrl('document/edit', array('id' => $post['id'])));
}
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例2: actionAddDoctor
public function actionAddDoctor()
{
try {
$attr = StringHelper::filterArrayString($_POST);
Doctors::model()->addDoctor($attr);
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例3: actionAdd
public function actionAdd()
{
$attr = StringHelper::filterArrayString($_POST);
if (Comment::model()->add($attr['post_id'], $attr['user_id'], $attr['content'])) {
ResponseHelper::JsonReturnSuccess('', 'success');
} else {
ResponseHelper::JsonReturnError('', 'server error');
}
}
示例4: actionLogin
public function actionLogin()
{
$attr = StringHelper::filterArrayString($_POST);
$data = User::model()->login($attr);
if ($data) {
ResponseHelper::JsonReturnSuccess($data, 'success');
} else {
ResponseHelper::JsonReturnError('', 'server error');
}
}
示例5: actionUpdateProfile
public function actionUpdateProfile()
{
$attr = StringHelper::filterArrayString($_POST);
$obj_file = null;
if (isset($_FILES['avatar'])) {
$obj_file = $_FILES['avatar'];
}
$message = User::model()->updateProfile($attr, $obj_file);
ResponseHelper::JsonReturnSuccess('', $message);
}
示例6: actionOrder
public function actionOrder()
{
$post = StringHelper::filterArrayString($_POST);
$result = OrderMedlatec::model()->add($post);
if ($result != FALSE) {
ResponseHelper::JsonReturnSuccess($result, 'Success');
} else {
ResponseHelper::JsonReturnError('', 'Error');
}
}
示例7: actionAddSuggestion
public function actionAddSuggestion()
{
$args = StringHelper::filterArrayString($_POST);
$data = QuizSuggestion::model()->add($args);
if ($data) {
ResponseHelper::JsonReturnSuccess($data);
} else {
ResponseHelper::JsonReturnError('');
}
}
示例8: actionAddPharmacy
public function actionAddPharmacy()
{
$attr = StringHelper::filterArrayString($_POST);
$model = new Pharmacy();
$model->setAttributes($attr);
// $model->created_at = time();
//$model->updated_at = time();
if ($model->save(FALSE)) {
ResponseHelper::JsonReturnSuccess("", "Success");
} else {
ResponseHelper::JsonReturnError("", "Server Error");
}
}
示例9: actionAddCategory
public function actionAddCategory()
{
try {
$attr = StringHelper::filterArrayString($_POST);
if (Categories::model()->addCategory($attr)) {
ResponseHelper::JsonReturnSuccess('', 'Success');
} else {
ResponseHelper::JsonReturnSuccess('', 'Error');
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例10: actionAdd
public function actionAdd()
{
$attr = StringHelper::filterArrayString($_POST);
$image = null;
if (isset($_FILES['image'])) {
$image = $_FILES['image'];
}
if (Post::model()->add($attr, $image)) {
ResponseHelper::JsonReturnSuccess('', 'success');
} else {
ResponseHelper::JsonReturnError('', 'server error');
}
}
示例11: actionCreatePharmacy
public function actionCreatePharmacy()
{
try {
$attr = StringHelper::filterArrayString($_POST);
if (Pharmacy::model()->createPharmacy($attr)) {
ResponseHelper::JsonReturnSuccess("", "Success");
} else {
ResponseHelper::JsonReturnError("", "Error");
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例12: actionAddUserFeedback
public function actionAddUserFeedback()
{
try {
$attr = StringHelper::filterArrayString($_POST);
if (Feedback::model()->addUserFeedback($attr)) {
ResponseHelper::JsonReturnSuccess('', 'Success');
} else {
ResponseHelper::JsonReturnError('', 'Server Error');
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例13: actionEditGame
public function actionEditGame()
{
try {
$args = StringHelper::filterArrayString($_POST);
$data = Game::model()->editGame($args);
if ($data) {
ResponseHelper::JsonReturnSuccess('');
} else {
ResponseHelper::JsonReturnError('');
}
} catch (Exception $ex) {
ResponseHelper::JsonReturnError($ex->getMessage());
}
}
示例14: actionAddEvent
public function actionAddEvent()
{
try {
$attr = StringHelper::filterArrayString($_POST);
$image = UploadHelper::getUrlUploadSingleImage($_FILES['image'], $_POST['created_by']);
if (Events::model()->addEvent($attr, $image)) {
ResponseHelper::JsonReturnSuccess('', 'Success');
} else {
ResponseHelper::JsonReturnError('', 'Server Error');
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}
示例15: actionEditRemind
public function actionEditRemind()
{
try {
$post = StringHelper::filterArrayString($_POST);
$remind_id = StringHelper::filterString(Yii::app()->request->getPost('remind_id'));
if (MedicineRemind::model()->editRemind($remind_id, $post)) {
ResponseHelper::JsonReturnSuccess('', 'Success');
} else {
ResponseHelper::JsonReturnError('', 'Error !');
}
} catch (Exception $ex) {
var_dump($ex->getMessage());
}
}