本文整理汇总了PHP中Theme::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::validate方法的具体用法?PHP Theme::validate怎么用?PHP Theme::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::validate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCurrentTheme
public static function setCurrentTheme($x)
{
self::$set_theme = $x;
$theme = new Theme(self::$set_theme);
if ($theme->validate()) {
self::$curr_theme = $theme;
}
}
示例2: actionCreate
public function actionCreate()
{
$model = new Theme();
$suc = Yii::t('info', 'The record was successfully created');
$err = Yii::t('info', 'The record could not be created');
$zip = new XUploadForm();
$userZips = array();
if (!isset($_POST[$this->modelName])) {
Yii::app()->user->setState('images', NULL);
}
if (isset($_POST['Theme'])) {
$model->attributes = $_POST['Theme'];
$userZips = Yii::app()->user->getState('images');
if ($model->validate()) {
//$path = Yii::app()->runtimePath.'/dir/'.$model->zip;
//$img->saveAs('dir/'.$model->name);
$model->save();
$path = $userZips[0]["path"];
$this->unzipTheme($path, $model->name, UtilityHelper::yiiparam('frontPath') . "/www/themes");
Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_SUCCESS, $suc);
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->renderPartial('_view', array('model' => $model), false, true);
Yii::app()->end();
} else {
$this->redirect(array('view', 'id' => $model->id));
}
} else {
Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_ERROR, $err);
}
UtilityHelper::sendToLog($userZips);
}
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->renderPartial('_form', array('model' => $model, 'zip' => $zip, 'userZips' => $userZips), false, true);
Yii::app()->end();
}
$this->render('create', array('model' => $model, 'zip' => $zip, 'userZips' => $userZips));
}
示例3: getTheme
public function getTheme()
{
if (!array_key_exists('theme', $this->info)) {
$settings = (array) $this->getSettings();
plugin('page_gettheme', array($settings));
$settings = filter('page_gettheme', $settings);
if (array_key_exists('theme', $settings)) {
$theme = new Theme($settings['theme']);
if ($theme->validate()) {
$this->info['theme'] = $theme->getName();
}
} else {
$this->info['theme'] = Settings::get('site', 'theme', true);
}
}
return filter('node_theme', $this->info['theme']);
}
示例4: Theme
<?php
include_once "Theme.php";
include "theme_database.php";
$theme = new Theme();
$theme->theme = $_POST["theme"];
if ($theme->validate()) {
echo "is valid";
echo $theme->toString();
} else {
echo "Try Again";
}
getConnection();
#insertTheme($theme-> theme = $_POST["theme"]);
#retrieveThemeById($id = 7);
#updateTheme($id = 7,$theme->theme = $_POST["theme"]);
deleteThemeById($id = 8);