当前位置: 首页>>代码示例>>PHP>>正文


PHP Theme::validate方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:8,代码来源:cc-themes.php

示例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));
 }
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:37,代码来源:ThemeController.php

示例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']);
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:17,代码来源:cc-content.php

示例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);
开发者ID:asvaldenegro,项目名称:CYL,代码行数:17,代码来源:ProcessCreateNewTheme.php


注:本文中的Theme::validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。