本文整理匯總了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"));
}