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


PHP Tag::anyhow方法代码示例

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


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

示例1: parse

 public static function parse(&$src)
 {
     $result = array();
     foreach (Tag::anyhow($src)->in("source") as $in) {
         $src = str_replace($in->plain(), "", $src);
         $o = new self();
         $o->url($in->inParam("url"));
         $o->value($in->value());
         $result[] = $o;
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:12,代码来源:RssSource.php

示例2: parse

 public static function parse(&$src)
 {
     $result = array();
     foreach (Tag::anyhow($src)->in("enclosure") as $in) {
         $src = str_replace($in->plain(), "", $src);
         $o = new self();
         $o->url($in->inParam("url"));
         $o->type($in->inParam("type"));
         $o->length($in->inParam("length"));
         $result[] = $o;
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:13,代码来源:RssEnclosure.php

示例3: parse

 public static function parse(&$src)
 {
     $result = array();
     foreach (Tag::anyhow($src)->in("author") as $in) {
         $src = str_replace($in->plain(), "", $src);
         $o = new self();
         $o->name($in->f("name.value()"));
         $o->url($in->f("url.value()"));
         $o->email($in->f("email.value()"));
         $result[] = $o;
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:13,代码来源:AtomAuthor.php

示例4: parse

 public static function parse(&$src)
 {
     $result = array();
     foreach (Tag::anyhow($src)->in("link") as $in) {
         $o = new self();
         $o->href($in->inParam("href"));
         $o->rel($in->inParam("rel"));
         $o->type($in->inParam("type"));
         $result[] = $o;
         $src = str_replace($in->plain(), "", $src);
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:13,代码来源:AtomLink.php

示例5: parse

 public static function parse($src)
 {
     $result = array();
     foreach (Tag::anyhow($src)->in("item") as $in) {
         $o = new self();
         $o->title($in->f("title.value()"));
         $o->link($in->f("link.value()"));
         $o->description($in->f("description.value()"));
         $o->author($in->f("author.value()"));
         $o->category($in->f("category.value()"));
         $o->comments($in->f("comments.value()"));
         $o->pubDate($in->f("pubDate.value()"));
         $o->guid($in->f("guid.value()"));
         $value = $in->value();
         $o->enclosure = RssEnclosure::parse($value);
         $o->source = RssSource::parse($src);
         $result[] = $o;
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:20,代码来源:RssItem.php

示例6: title

 /**
  * ページタイトル
  *
  * @return string
  */
 public function title()
 {
     return Tag::anyhow($this->body)->f("title.value()");
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:9,代码来源:HttpSpider.php

示例7: br2nl

 /**
  * brタグを改行コードに変換
  * @param $src 変換する文字列
  * @return string
  */
 public function br2nl($src)
 {
     foreach (Tag::anyhow($src)->in("br") as $t) {
         $src = str_replace($t->get(), "\n", $src);
     }
     return $src;
     /***
     			$body = text('hoge<br />hoge<br>hoge<br /><br />hoge');
     			$t = new self();
     			eq("hoge\nhoge<br>hoge\n\nhoge",$t->br2nl($body));
     		 */
 }
开发者ID:satully,项目名称:dev_socialapp,代码行数:17,代码来源:Templf.php

示例8: parse

 public static function parse($src)
 {
     $args = func_get_args();
     array_shift($args);
     if (Tag::setof($tag, $src, "feed") && $tag->inParam("xmlns") == self::$XMLNS) {
         $result = new self();
         $value = $tag->value();
         $tag = Tag::anyhow($value);
         $result->id($tag->f("id.value()"));
         $result->title($tag->f("title.value()"));
         $result->subtitle($tag->f("subtitle.value()"));
         $result->updated($tag->f("updated.value()"));
         $result->generator($tag->f("generator.value()"));
         $value = $tag->value();
         $result->entry = call_user_func_array(array("AtomEntry", "parse"), array_merge(array(&$value), $args));
         $result->link = AtomLink::parse($value);
         $result->author = AtomAuthor::parse($value);
         return $result;
     }
     throw new Exception("no atom");
     /***
     			$src = text('
     						<feed xmlns="http://www.w3.org/2005/Atom">
     							<title>atom10 feed</title>
     							<subtitle>atom10 sub title</subtitle>
     							<updated>2007-07-18T16:16:31+00:00</updated>
     							<generator>tokushima</generator>
     							<link href="http://tokushimakazutaka.com" rel="abc" type="xyz" />
     
     							<author>
     								<url>http://tokushimakazutaka.com</url>
     								<name>tokushima</name>
     								<email>tokushima@hoge.hoge</email>
     							</author>
     
     							<entry>
     								<title>rhaco</title>
     								<summary type="xml" xml:lang="ja">summary test</summary>
     								<content type="text/xml" mode="abc" xml:lang="ja" xml:base="base">atom content</content>
     								<link href="http://rhaco.org" rel="abc" type="xyz" />
     								<link href="http://conveyor.rhaco.org" rel="abc" type="conveyor" />
     								<link href="http://lib.rhaco.org" rel="abc" type="lib" />
     
     							 <updated>2007-07-18T16:16:31+00:00</updated>
     							 <issued>2007-07-18T16:16:31+00:00</issued>
     							 <published>2007-07-18T16:16:31+00:00</published>
     							 <id>rhaco</id>
     							<author>
     								<url>http://rhaco.org</url>
     								<name>rhaco</name>
     								<email>rhaco@rhaco.org</email>
     							</author>
     							</entry>
     
     							<entry>
     								<title>django</title>
     								<summary type="xml" xml:lang="ja">summary test</summary>
     								<content type="text/xml" mode="abc" xml:lang="ja" xml:base="base">atom content</content>
     								<link href="http://djangoproject.jp" rel="abc" type="xyz" />
     
     							 <updated>2007-07-18T16:16:31+00:00</updated>
     							 <issued>2007-07-18T16:16:31+00:00</issued>
     							 <published>2007-07-18T16:16:31+00:00</published>
     							 <id>django</id>
     							<author>
     								<url>http://www.everes.net</url>
     								<name>everes</name>
     								<email>everes@hoge.hoge</email>
     							</author>
     							</entry>
     						</feed>
     					');
     
     			$xml = Atom::parse($src);
     			eq("atom10 feed",$xml->title());
     			eq("atom10 sub title",$xml->subtitle());
     			eq(1184775391,$xml->updated());
     			eq("2007-07-18T16:16:31Z",$xml->fmUpdated());
     			eq("tokushima",$xml->generator());
     			eq(2,sizeof($xml->entry()));
     		*/
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:82,代码来源:Atom.php

示例9: __new__

 protected function __new__($user, $password)
 {
     $this->wsse($user, $password);
     $this->member_id = preg_replace("/^.+\\?id=(\\d+)\$/", "\\1", Tag::anyhow($this->do_post("http://mixi.jp/atom/tracks")->body())->f("atom:author.atom:uri.value()"));
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:5,代码来源:Mixi.php

示例10: tableTrEvenodd

 private final function tableTrEvenodd($src, $name, $counter)
 {
     $tag = Tag::anyhow($src);
     foreach ($tag->in($name) as $tr) {
         $class = $tr->inParam("class");
         if ($class == "even" || $class == "odd") {
             $tr->param("class", "{\$t.evenodd(\$" . $counter . ")}");
             $src = str_replace($tr->plain(), $tr->get(), $src);
         }
     }
     return $src;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:12,代码来源:Template.php

示例11: parse_form

 private function parse_form()
 {
     $tag = Tag::anyhow($this->body);
     foreach ($tag->in("form") as $key => $formtag) {
         $form = new stdClass();
         $form->name = $formtag->in_param("name", $formtag->in_param("id", $key));
         $form->action = File::absolute($this->url, $formtag->in_param("action", $this->url));
         $form->method = strtolower($formtag->in_param("method", "get"));
         $form->multiple = false;
         $form->element = array();
         foreach ($formtag->in("input") as $count => $input) {
             $obj = new stdClass();
             $obj->name = $input->in_param("name", $input->in_param("id", "input_" . $count));
             $obj->type = strtolower($input->in_param("type", "text"));
             $obj->value = Text::htmldecode($input->in_param("value"));
             $obj->selected = "selected" === strtolower($input->in_param("checked", $input->in_attr("checked")));
             $obj->multiple = false;
             $form->element[] = $obj;
         }
         foreach ($formtag->in("textarea") as $count => $input) {
             $obj = new stdClass();
             $obj->name = $input->in_param("name", $input->in_param("id", "textarea_" . $count));
             $obj->type = "textarea";
             $obj->value = Text::htmldecode($input->value());
             $obj->selected = true;
             $obj->multiple = false;
             $form->element[] = $obj;
         }
         foreach ($formtag->in("select") as $count => $input) {
             $obj = new stdClass();
             $obj->name = $input->in_param("name", $input->in_param("id", "select_" . $count));
             $obj->type = "select";
             $obj->value = array();
             $obj->selected = true;
             $obj->multiple = "multiple" == strtolower($input->param("multiple", $input->attr("multiple")));
             foreach ($input->in("option") as $count => $option) {
                 $op = new stdClass();
                 $op->value = Text::htmldecode($option->in_param("value", $option->value()));
                 $op->selected = "selected" == strtolower($option->in_param("selected", $option->in_attr("selected")));
                 $obj->value[] = $op;
             }
             $form->element[] = $obj;
         }
         $this->form[] = $form;
     }
 }
开发者ID:satully,项目名称:dev_socialapp,代码行数:46,代码来源:Http.php

示例12: parse

 public static function parse(&$src)
 {
     $args = func_get_args();
     array_shift($args);
     $result = array();
     foreach (Tag::anyhow($src)->in("entry") as $in) {
         $o = new self();
         foreach ($args as $module) {
             $o->add_modules($module);
         }
         $o->id($in->f("id.value()"));
         $o->title($in->f("title.value()"));
         $o->published($in->f("published.value()"));
         $o->updated($in->f("updated.value()"));
         $o->issued($in->f("issued.value()"));
         $value = $in->value();
         $o->content = AtomContent::parse($value);
         $o->summary = AtomSummary::parse($value);
         $o->link = AtomLink::parse($value);
         $o->author = AtomAuthor::parse($value);
         $o->parse_extra($value);
         $result[] = $o;
         $src = str_replace($in->plain(), "", $src);
     }
     return $result;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:26,代码来源:AtomEntry.php

示例13: table_tr_even_odd

 private final function table_tr_even_odd($src, $name, $even_odd)
 {
     $tag = Tag::anyhow($src);
     foreach ($tag->in($name) as $tr) {
         $class = ' ' . $tr->in_param('class') . ' ';
         if (preg_match('/[\\s](even|odd)[\\s]/', $class, $match)) {
             $tr->param('class', trim(str_replace($match[0], ' {$' . $even_odd . '} ', $class)));
             $src = str_replace($tr->plain(), $tr->get(), $src);
         }
     }
     return $src;
 }
开发者ID:satully,项目名称:dev_socialapp,代码行数:12,代码来源:Template.php


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