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


PHP Option::up方法代码示例

本文整理汇总了PHP中common\models\Option::up方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::up方法的具体用法?PHP Option::up怎么用?PHP Option::up使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common\models\Option的用法示例。


在下文中一共展示了Option::up方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGroup

 public function testGroup(FunctionalTester $I)
 {
     $I->wantTo('ensure that setting works');
     $I->amOnPage(Url::to(['/setting/group', 'id' => 'general']));
     $I->see('General Settings', 'h1');
     $I->amGoingTo('update site title and tag line');
     $I->fillField('input[name="Option[sitetitle][option_value]"]', 'My New Website');
     $I->fillField('input[name="Option[tagline][option_value]"]', 'My New Website Tagline');
     $I->click('Save');
     $I->expectTo('see success message');
     $I->see('Settings successfully saved.');
     Option::up('sitetitle', 'WritesDown');
     Option::up('tagline', 'CMS Built with Yii Framework');
 }
开发者ID:ochiem,项目名称:app-cms,代码行数:14,代码来源:SettingCest.php

示例2: testIndex

 /**
  * @param AcceptanceTester $I
  */
 public function testIndex(AcceptanceTester $I)
 {
     $I->wantTo('ensure that index theme works');
     $I->amOnPage(Url::to(['/theme/index']));
     $I->see('Themes', 'h1');
     $I->seeLink('Available Themes');
     $I->seeLink('Add New Theme');
     if (method_exists($I, 'acceptPopup') && method_exists($I, 'wait')) {
         $I->amGoingTo('activate theme');
         $I->click('a[href="' . Url::to(['/theme/install', 'theme' => 'writesdown']) . '"]');
         $I->acceptPopup();
         $I->wait(3);
         $I->expectTo('see theme installed');
         $I->see('Installed');
         Option::up('theme', 'default');
     }
 }
开发者ID:ochiem,项目名称:app-cms,代码行数:20,代码来源:ThemeCest.php

示例3: testSignup

 /**
  * @param AcceptanceTester $I
  */
 public function testSignup(AcceptanceTester $I)
 {
     Option::up('allow_signup', '1');
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Register a new membership', 'p');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validations error');
     $I->see('Username cannot be blank.', '.help-block');
     $I->see('Email cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->amGoingTo('submit signup form with no correct email and password');
     $signupPage->submit(['username' => 'newuser', 'email' => 'newuser.email', 'password' => 'pass']);
     $I->expectTo('see that email and password are not correct.');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->see('Email is not a valid email address.', '.help-block');
     $I->see('Password should contain at least 6 characters.', '.help-block');
     $I->amGoingTo('submit signup form with correct data');
     $signupPage->submit(['username' => 'newuser', 'email' => 'newuser@writesdown.dev', 'password' => 'password']);
     $I->expect('new user saved.');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Email is not a valid email address.', '.help-block');
     $I->dontSee('Password should contain at least 6 characters.', '.help-block');
     User::deleteAll(['username' => 'newuser']);
     Option::up('allow_signup', '0');
 }
开发者ID:hdushku,项目名称:app-cms,代码行数:30,代码来源:SiteCest.php

示例4: actionGroup

 /**
  * Render option page for specific group of option.
  * It will use group file if exist.
  *
  * @param string $id
  *
  * @return mixed
  */
 public function actionGroup($id)
 {
     $model = $this->findModelByGroup($id);
     if ($options = Yii::$app->request->post('Option')) {
         foreach ($options as $optionName => $option) {
             Option::up($optionName, $option['option_value']);
         }
         Yii::$app->getSession()->setFlash('success', Yii::t('writesdown', 'Settings successfully saved.'));
         return $this->redirect(['group', 'id' => $id]);
     }
     if (is_file($this->getViewPath() . '/' . strtolower($id) . '.php')) {
         return $this->render(strtolower($id), ['model' => (object) $model, 'group' => $id]);
     }
     return $this->redirect(['index']);
 }
开发者ID:tampaphp,项目名称:app-cms,代码行数:23,代码来源:SettingController.php

示例5: actionGroup

 /**
  * Render option page for specific group of option.
  * It will use group file if exist.
  *
  * @param string $id group name
  *
  * @return string|\yii\web\Response
  * @throws \yii\web\NotFoundHttpException
  */
 public function actionGroup($id)
 {
     $model = Option::find()->where(['option_group' => $id])->indexBy('option_name')->all();
     if ($options = Yii::$app->request->post('Option')) {
         foreach ($options as $option_name => $option) {
             Option::up($option_name, $option['option_value']);
         }
         Yii::$app->getSession()->setFlash('success', Yii::t('writesdown', 'Settings successfully saved.'));
         return $this->redirect(['group', 'id' => $id]);
     }
     if ($model) {
         if (is_file($viewFile = $this->getViewPath() . '/' . strtolower($id) . '.php')) {
             return $this->render(strtolower($id), ['model' => (object) $model, 'group' => $id]);
         } else {
             return $this->redirect(['index']);
         }
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
开发者ID:ochiem,项目名称:app-cms,代码行数:29,代码来源:SettingController.php


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