コード例 #1
0
ファイル: LiquidTag.class.php プロジェクト: rip747/php-liquid
 /**
  * Extracts tag attributes from a markup string
  *
  * @param string $markup
  */
 public function extract_attributes($markup)
 {
     $this->attributes = array();
     $attribute_regexp = new LiquidRegexp(LIQUID_TAG_ATTRIBUTES);
     $matches = $attribute_regexp->scan($markup);
     foreach ($matches as $match) {
         $this->attributes[$match[0]] = $match[1];
     }
 }
コード例 #2
0
ファイル: regexp_test.php プロジェクト: Bredo/php-liquid
 function test_quoted_words_in_the_middle()
 {
     $this->assertEqual(array('arg1', 'arg2', '"arg 3"', 'arg4'), $this->regexp->scan('arg1 arg2 "arg 3" arg4   '));
 }