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


PHP data::get方法代码示例

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


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

示例1: testAjax

 public function testAjax()
 {
     $this->module->sendAjaxGetRequest('/info');
     $this->assertNotNull(data::get('ajax'));
     $this->module->sendAjaxPostRequest('/form/complex', array('show' => 'author'));
     $this->assertNotNull(data::get('ajax'));
     $post = data::get('form');
     $this->assertEquals('author', $post['show']);
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:9,代码来源:PhpBrowserTest.php

示例2: get_helper

 public function get_helper($key)
 {
     $ret = null;
     $in_helper = false;
     if (isset($this->helper[$key])) {
         $ret = $this->helper[$key];
         $in_helper = true;
     } else {
         $class = 'view_helper_' . $key;
         if (class_exists($class)) {
             $this->helper[$key] = new $class();
             $ret = $this->helper[$key];
             $in_helper = true;
         } else {
             $ret = parent::get($key);
         }
     }
     if ($in_helper) {
         $ret->view = $this;
     }
     return $ret;
 }
开发者ID:s-kalaus,项目名称:ekernel,代码行数:22,代码来源:view.php

示例3: testFillFieldWithAmpersand

 public function testFillFieldWithAmpersand()
 {
     $this->module->amOnPage('/form/field');
     $this->module->fillField('Name', 'this & that');
     $this->module->click('Submit');
     $form = data::get('form');
     $this->assertEquals('this & that', $form['name']);
 }
开发者ID:yurireeis,项目名称:CodeCeptionTest,代码行数:8,代码来源:TestsForWeb.php

示例4: testFileFieldByLabel

 public function testFileFieldByLabel()
 {
     $this->module->amOnPage('/form/file');
     $this->module->attachFile('Avatar', 'app/avatar.jpg');
     $this->module->click('Submit');
     $this->assertNotEmpty(data::get('files'));
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:7,代码来源:TestsForMink.php

示例5: testSubmitFormWithQueries

 /**
  * @Issue https://github.com/Codeception/Codeception/issues/933
  */
 public function testSubmitFormWithQueries()
 {
     $this->module->amOnPage('/form/example3');
     $this->module->seeElement('form');
     $this->module->submitForm('form', array('name' => 'jon'));
     $form = data::get('form');
     $this->assertEquals('jon', $form['name']);
     $this->module->seeCurrentUrlEquals('/form/example3?validate=yes');
 }
开发者ID:augustus-amalejo,项目名称:palittayo,代码行数:12,代码来源:PhpBrowserTest.php

示例6: getUser

 public static function getUser()
 {
     if (self::$session && self::$session['logged_in'] == 1 && !isset(self::$user)) {
         $res = data::get('user', 'get', array('users_id'));
         self::$user = false;
         if (!$res['error']) {
             self::$user = $res['data'];
         }
     }
     return self::$user;
 }
开发者ID:soldair,项目名称:solumLite,代码行数:11,代码来源:sessioncookie.class.php

示例7: parse_view

 /**
  * parse the rendered view for {{placeholders}} and replace them
  * @param string $view the rendered view (typically html) possibly containing {{placeholders}}
  * @return string
  */
 private function parse_view($view)
 {
     $v = view::getInstance();
     $app = \maverick\maverick::getInstance();
     // check for the use of multi-lingual gettext stuff
     if ($app->get_config('lang.active') !== false) {
         // match the format of {{_('string to translate')}} - the quote style can be either single or double,
         // and the text to translate must start with a letter \p{L}
         if (preg_match_all('/\\{\\{_\\(([\'"]\\p{L}[^\'"]+[\'"])\\)\\}\\}/', $view, $matches) && !empty($matches[1])) {
             $find = $replace = array();
             foreach ($matches[1] as $match) {
                 $find[] = "{{_({$match})}}";
                 $replace[] = _(trim($match, "\"'"));
             }
             $view = str_replace($find, $replace, $view);
         }
     }
     // run any custom handlers that have been added - the callback will pass up to three matched parameters in the form
     // {{handler_namespacee:param1:param2:param3}} with each matched parameter being in an array with
     // param1 being array index 1, param2 being array index 3, and param3 being array index5
     // the callback method must be a static method, and the return must be a string
     if (count($v->parse_handlers)) {
         foreach ($v->parse_handlers as $parse_handler) {
             list($controller, $method) = explode('->', $parse_handler[1]);
             $view = preg_replace_callback("/\\{\\{{$parse_handler[0]}:([\\p{L}\\p{N}_]+)(:([\\p{L}\\p{N}_]+))?(:([\\p{L}\\p{N}_]+))?\\}\\}/", array($controller, $method), $view);
         }
     }
     // match simple placeholder formats - this check should always be last
     if (preg_match_all('/\\{\\{(\\p{L}[\\p{L}\\p{N}_\\.]+)/', $view, $matches) && !empty($matches[1])) {
         $find = $replace = array();
         foreach ($matches[1] as $match) {
             $find[] = "{{{$match}}}";
             $r = \data::get($match);
             if (is_array($r)) {
                 $r = implode($r);
             }
             $replace[] = $r;
         }
         $view = str_replace($find, $replace, $view);
     }
     return $view;
 }
开发者ID:AshleyJSheridan,项目名称:tweed,代码行数:47,代码来源:view.php

示例8: testUnreachableField

 /**
  * @Issue https://github.com/Codeception/Codeception/issues/1585
  * @Issue https://github.com/Codeception/Codeception/issues/1602
  */
 public function testUnreachableField()
 {
     $this->module->amOnPage('/form/bug1585');
     $this->module->fillField('textarea[name="captions[]"]', 'test2');
     $this->module->fillField('items[1][]', 'test3');
     $this->module->fillField('input[name="users[]"]', 'davert');
     $this->module->attachFile('input[name="files[]"]', 'app/avatar.jpg');
     $this->module->click('Submit');
     $data = data::get('form');
     $this->assertContains('test3', $data['items'][1]);
     $this->assertContains('test2', $data['captions']);
     $this->assertContains('davert', $data['users']);
 }
开发者ID:augustus-amalejo,项目名称:palittayo,代码行数:17,代码来源:TestsForWeb.php

示例9:

<?php

include MAVERICK_VIEWSDIR . 'includes/header.php';
include MAVERICK_VIEWSDIR . '' . data::get('page') . '.php';
include MAVERICK_VIEWSDIR . 'includes/footer.php';
开发者ID:AshleyJSheridan,项目名称:tweed,代码行数:5,代码来源:template.php

示例10: testSelectOptionValueSelector

 public function testSelectOptionValueSelector()
 {
     $this->module->amOnPage('/form/select_selectors');
     $this->module->selectOption('age', ['value' => '20']);
     $this->module->click('Submit');
     $data = data::get('form');
     $this->assertEquals('20', $data['age']);
 }
开发者ID:janhenkgerritsen,项目名称:Codeception,代码行数:8,代码来源:TestsForWeb.php

示例11: testFormWithFileSpecialCharNames

 public function testFormWithFileSpecialCharNames()
 {
     $this->module->amOnPage('/form/example14');
     $this->module->attachFile('foo bar', 'app/avatar.jpg');
     $this->module->attachFile('foo.baz', 'app/avatar.jpg');
     $this->module->click('Submit');
     $this->assertNotEmpty(data::get('files'));
     $files = data::get('files');
     $this->assertNotEmpty($files);
     $this->assertArrayHasKey('foo_bar', $files);
     $this->assertArrayHasKey('foo_baz', $files);
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:12,代码来源:TestsForWeb.php

示例12: testSubmitFormDoesNotKeepGetParameters

 /**
  * @issue https://github.com/Codeception/Codeception/issues/2841
  */
 public function testSubmitFormDoesNotKeepGetParameters()
 {
     $this->module->amOnPage('/form/bug2841?stuff=other');
     $this->module->fillField('#texty', 'thingshjere');
     $this->module->click('#submit-registration');
     $this->assertEmpty(data::get('query'), 'Query string is not empty');
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:10,代码来源:PhpBrowserTest.php

示例13: testArrayFieldSubmitForm

 public function testArrayFieldSubmitForm()
 {
     $this->module->amOnPage('/form/example17');
     $this->module->submitForm('form', ['FooBar' => ['bar' => 'booze'], 'Food' => ['beer' => ['yum' => ['yeah' => 'crunked']]]]);
     $data = data::get('form');
     $this->assertEquals('booze', $data['FooBar']['bar']);
     $this->assertEquals('crunked', $data['Food']['beer']['yum']['yeah']);
 }
开发者ID:codeception,项目名称:base,代码行数:8,代码来源:PhpBrowserTest.php

示例14: testComplexSelectorsAndForms

 public function testComplexSelectorsAndForms()
 {
     $this->module->amOnPage('/login');
     $this->module->submitForm('form#user_form_login', array('email' => 'miles@davis.com', 'password' => '111111'));
     $post = data::get('form');
     $this->assertEquals('miles@davis.com', $post['email']);
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:7,代码来源:FrameworksTest.php

示例15: testComplexFormsAndXPath

 public function testComplexFormsAndXPath()
 {
     $this->module->amOnPage('/login');
     $this->module->submitForm("descendant-or-self::form[@id='user_form_login']", array('email' => 'miles@davis.com', 'password' => '111111'));
     $post = data::get('form');
     $this->assertEquals('miles@davis.com', $post['email']);
 }
开发者ID:pfz,项目名称:codeception,代码行数:7,代码来源:FrameworksTest.php


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