本文整理汇总了PHP中SiteHelper::checkedVaribal方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelper::checkedVaribal方法的具体用法?PHP SiteHelper::checkedVaribal怎么用?PHP SiteHelper::checkedVaribal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteHelper
的用法示例。
在下文中一共展示了SiteHelper::checkedVaribal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex($slugInput = "")
{
$error = false;
$slug = !empty($_GET["slug"]) ? $slug = SiteHelper::checkedVaribal($_GET["slug"]) : "";
if (empty($slug) && !empty($slugInput)) {
$slug = $slugInput;
}
if (!empty($slug)) {
$page = CatalogContent::fetchBySlug($slug);
}
if (!empty($page) && $page->id > 0) {
$this->render('index', array("page" => $page));
} else {
$this->redirect("/site/error");
}
}
示例2: check_passwords
public function check_passwords($attribute, $params)
{
if (!$this->hasErrors()) {
$key = !empty($_GET["key"]) ? SiteHelper::checkedVaribal($_GET["key"], "string") : "";
$confirm = CatalogUsersConfirm::findByAttributes(array("confirm_key" => $key));
if (!empty($confirm) && sizeof($confirm) == 1) {
$userModel = CatalogUsers::fetch($confirm[0]->user_id->id);
if ($userModel->active == 0) {
$error = Yii::t("models", "Ваш аккаунт не активирован");
}
} else {
$error = Yii::t("models", "Указан не верный ключ");
}
if (!empty($error)) {
$this->addErrors(array("0" => $error));
} else {
$confirm[0]->delete();
}
}
}
示例3: gallerySaveTitle
public function gallerySaveTitle()
{
if (!empty($_POST["saveTitle"])) {
$id = (int) Yii::app()->request->getParam("id", 0);
if ($id > 0) {
$modelClass = SiteHelper::getCamelCase($this->tableName);
$item = $modelClass::fetch($id);
if ($item && $item->id > 0) {
if (!empty($_POST["ITitle"])) {
$values = $_POST["ITitle"];
} else {
$values = arrray();
}
$listGallery = CatGallery::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("catalog=:catalog AND item_id=:item_id")->setParams(array(":catalog" => $this->tableName, ":item_id" => $item->id))->setLimit(50)->setCache(0));
foreach ($listGallery as $itemGallery) {
$title = !empty($values[$itemGallery->id]) ? $values[$itemGallery->id] : "";
$itemGallery->name = SiteHelper::checkedVaribal($title);
$itemGallery->save();
if (is_array($itemGallery->getErrors) && sizeof($itemGallery->getErrors())) {
print_r($itemGallery->getErrors());
}
}
}
}
}
}
示例4: actionResend
public function actionResend()
{
$email = SiteHelper::checkedVaribal(Yii::app()->request->getParam("email", ""), "string");
if (!empty($email)) {
$userModel = CatalogUsers::findByAttributes(array("email" => $email));
if (is_array($userModel) && sizeof($userModel) > 0 && $userModel[0]->active == 0) {
$userModel[0]->onRegistration(new CModelEvent($userModel[0]), array());
$this->render("resend", array("user" => $userModel));
}
}
// die;
$this->redirect(SiteHelper::createUrl("/user"));
}