• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SimpleTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

 /**
  *    Creates the request packet to be sent by the form.
  *    @param SimpleTag $tag        Form tag to read.
  *    @return string               Packet class.
  *    @access private
  */
 function _setEncodingClass($tag) {
     if (strtolower($tag->getAttribute('method')) == 'post') {
         if (strtolower($tag->getAttribute('enctype')) == 'multipart/form-data') {
             return 'SimpleMultipartEncoding';
         }
         return 'SimplePostEncoding';
     }
     return 'SimpleGetEncoding';
 }
开发者ID:nuckey,项目名称:moodle,代码行数:15,代码来源:form.php


示例2: SimpleForm

 /**
  *    Starts with no held controls/widgets.
  *    @param SimpleTag $tag        Form tag to read.
  *    @param SimpleUrl $url        Location of holding page.
  */
 function SimpleForm($tag, $url)
 {
     $this->_method = $tag->getAttribute('method');
     $this->_action = $this->_createAction($tag->getAttribute('action'), $url);
     $this->_default_target = false;
     $this->_id = $tag->getAttribute('id');
     $this->_buttons = array();
     $this->_images = array();
     $this->_widgets = array();
 }
开发者ID:BGCX067,项目名称:ezpdo2-svn-to-git,代码行数:15,代码来源:form.php


示例3: puchipuchi

 function puchipuchi($staff = 'Arai', $action = '', $comment = '')
 {
     $this->method = 'puchipuchi';
     $result = $this->post(compact('staff', 'action', 'comment'));
     if (SimpleTag::setof($tag, $result, 'rsp')) {
         return $tag->toHash();
     }
     return false;
 }
开发者ID:riaf,项目名称:private-arbo,代码行数:9,代码来源:MubohAPI.php


示例4: upload

 function upload()
 {
     if ($this->isPost() && $this->isFile('stage')) {
         $file = $this->getFile('stage');
         $src = mb_convert_encoding(file_get_contents($file->tmp), 'utf-8', 'Shift_JIS,EUC-JP,UTF-8');
         if (SimpleTag::setof($tag, $src, 'body', true)) {
             foreach ($tag->getIn('applet') as $applet) {
                 if ($applet->getParameter('code') != 'MasaoConstruction') {
                     continue;
                 }
                 $gamedata = array();
                 foreach ($applet->getIn('param') as $param) {
                     $gamedata[$param->getParameter('name')] = array('name' => $param->getParameter('name'), 'value' => $param->getParameter('value'));
                 }
                 if (empty($gamedata)) {
                     break;
                 }
                 $stage = $this->dbUtil->insert($this->toObject(new Stage()));
                 if (!Variable::istype('Stage', $stage)) {
                     break;
                 }
                 $_images = array('title', 'ending', 'gameover', 'pattern', 'chizu');
                 foreach ($_images as $k) {
                     if (!isset($gamedata[sprintf("filename_%s", $k)])) {
                         continue;
                     }
                     $gamedata[sprintf("filename_%s", $k)] = array('name' => sprintf("filename_%s", $k), 'value' => 'images/' . $k . '.gif');
                     if ($this->isFile('img_' . $k)) {
                         $image = $this->getFile('img_' . $k);
                         $img_info = getimagesize($image->tmp);
                         if ($img_info[2] != IMAGETYPE_GIF) {
                             continue;
                         }
                         $filename = Rhaco::path(sprintf('images/%s_%d.gif', $k, $stage->id));
                         if (move_uploaded_file($image->tmp, $filename)) {
                             $gamedata[sprintf("filename_%s", $k)] = array('name' => sprintf("filename_%s", $k), 'value' => sprintf("images/%s_%d.gif", $k, $stage->getId()));
                         }
                     }
                 }
                 FileUtil::write(Rhaco::path(sprintf('stages/%d.apif', $stage->id)), serialize($gamedata));
                 Header::redirect(Rhaco::url());
                 Rhaco::end();
             }
         }
     }
     return $this->parser('upload.html');
 }
开发者ID:riaf,项目名称:concert,代码行数:47,代码来源:ConcertView.php


示例5: publish

 function publish($src, &$paraser)
 {
     if (ExceptionTrigger::isException() && stripos($src, 'form ') !== false && SimpleTag::setof($tag, $src)) {
         foreach ($tag->getIn('input') as $input) {
             if (ExceptionTrigger::invalid($input->param('name'))) {
                 // どうやら発行されているようだ
                 $exceptions = ExceptionTrigger::get($input->param('name'));
                 $addHtml = '';
                 foreach ($exceptions as $e) {
                     $addHtml .= sprintf('<%s class="%s">%s</%s>', $this->tagName, $this->class, $e->getMessage(), $this->tagName);
                 }
                 $src = str_replace($input->getPlain(), $input->getPlain() . $addHtml, $src);
             }
         }
     }
     return $src;
 }
开发者ID:riaf,项目名称:private-arbo,代码行数:17,代码来源:HtmlFormExceptionFilter.php


示例6: acceptTag

 /**
  *    Adds a tag to the page.
  *    @param SimpleTag $tag        Tag to accept.
  *    @access public
  */
 function acceptTag(&$tag)
 {
     if ($tag->getTagName() == "a") {
         $this->_addLink($tag);
     } elseif ($tag->getTagName() == "title") {
         $this->_setTitle($tag);
     } elseif ($this->_isFormElement($tag->getTagName())) {
         for ($i = 0; $i < count($this->_open_forms); $i++) {
             $this->_open_forms[$i]->addWidget($tag);
         }
         $this->_last_widget =& $tag;
     }
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:18,代码来源:page.php


示例7: SimpleForm

 /**
  *    Starts with no held controls/widgets.
  *    @param SimpleTag $tag        Form tag to read.
  */
 function SimpleForm($tag) {
     $this->_method = $tag->getAttribute('method');
     $this->_action = $tag->getAttribute('action');
     $this->_id = $tag->getAttribute('id');
     $this->_buttons = array();
     $this->_images = array();
     $this->_widgets = array();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:tag.php


示例8: SimpleUrl

 /**
  *    Sets the base url for the page.
  *    @param SimpleTag $tag    Base URL for page.
  *    @access protected
  */
 function _setBase(&$tag)
 {
     $url = $tag->getAttribute('href');
     $this->_base = new SimpleUrl($url);
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:10,代码来源:page.php


示例9: acceptTag

 /**
  *    Adds a tag to the page.
  *    @param SimpleTag $tag        Tag to accept.
  *    @access public
  */
 protected function acceptTag($tag)
 {
     if ($tag->getTagName() == "a") {
         $this->page->addLink($tag);
     } elseif ($tag->getTagName() == "base") {
         $this->page->setBase($tag->getAttribute('href'));
     } elseif ($tag->getTagName() == "title") {
         $this->page->setTitle($tag);
     } elseif ($this->isFormElement($tag->getTagName())) {
         for ($i = 0; $i < count($this->open_forms); $i++) {
             $this->open_forms[$i]->addWidget($tag);
         }
         $this->last_widget = $tag;
     }
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:20,代码来源:php_parser.php


示例10: setBase

 /**
  *    Sets the base url for the page.
  *    @param SimpleTag $tag    Base URL for page.
  *    @access protected
  */
 protected function setBase($tag)
 {
     $url = $tag->getAttribute('href');
     $this->base = new SimpleUrl($url);
 }
开发者ID:googlecode-mirror,项目名称:bulldoc,代码行数:10,代码来源:page.php


示例11: _exec9002_smartyfunctions

 /**
  * smarty_function dispatcher
  *
  * @access protected
  * @param string $src
  */
 function _exec9002_smartyfunctions($src)
 {
     $tag = new SimpleTag();
     $smarty_plugin_list = $this->getSmartyPluginList();
     foreach ($smarty_plugin_list as $name => $plugin_config) {
         while ($tag->set($src, $this->_getTagName($name))) {
             if ($plugin_config['type'] == 'function') {
                 $param = $tag->toHash();
                 $src = str_replace($tag->getPlain(), $plugin_config['plugin']($param, $this), $src);
             } else {
                 if ($plugin_config['type'] == 'block') {
                     $repeat_before = true;
                     $repeat_after = false;
                     $param_list = $tag->getParameter();
                     foreach ($param_list as $param_tag) {
                         $param[$param_tag->getName()] = $param_tag->getValue();
                     }
                     $content = $tag->getValue();
                     //before(not return value)
                     $result = $plugin_config['plugin']($param, $content, $this, $repeat_before);
                     //after
                     $result = $plugin_config['plugin']($param, $content, $this, $repeat_after);
                     $src = str_replace($tag->getPlain(), $result, $src);
                 }
             }
         }
     }
     return $src;
 }
开发者ID:riaf,项目名称:ethna,代码行数:35,代码来源:Rhaco.php


示例12: indexWidgetById

 /**
  *  Fills the widget cache to speed up searching.
  *  @param SimpleTag $widget    Parsed widget to cache.
  */
 private function indexWidgetById($widget)
 {
     $id = $widget->getAttribute('id');
     if (!$id) {
         return;
     }
     if (!isset($this->widgets_by_id[$id])) {
         $this->widgets_by_id[$id] = array();
     }
     $this->widgets_by_id[$id][] = $widget;
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:15,代码来源:tidy_parser.php


示例13: SimpleForm

 /**
  *    Starts with no held controls/widgets.
  *    @param SimpleTag $tag        Form tag to read.
  */
 function SimpleForm($tag)
 {
     $this->_method = $tag->getAttribute("method");
     $this->_action = $tag->getAttribute("action");
     $this->_id = $tag->getAttribute("id");
     $this->_buttons = array();
     $this->_widgets = array();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:tag.php


示例14: _parse_data_double

 /**
  * Get the data pertaining to the given double tag.  This will
  * loop through arrays of given data
  *
  * Example Data:
  * $data = array(
  *     'books' => array(
  *         array(
  *             'title' => 'PHP for Dummies',
  *             'author' => 'John Doe'
  *         ),
  *         array(
  *             'title' => 'CodeIgniter for Dummies',
  *             'author' => 'Jane Doe'
  *         )
  *     )
  * );
  *
  * Example Tags:
  * {books}
  * {title} by {author}<br />
  * {/books}
  *
  * @access  private
  * @param   array   The double tag
  * @param   array   The data to parse
  * @return  mixed   Either the data for the tag or FALSE
  */
 private function _parse_data_double($tag, $data)
 {
     $return_data = '';
     foreach ($tag['segments'] as $segment) {
         if (!isset($data[$segment])) {
             return FALSE;
         }
         $data = $data[$segment];
     }
     $temp = new SimpleTag();
     foreach ($data as $val) {
         $return = $temp->parse($tag['content'], $val);
         $return_data .= $return['content'];
     }
     unset($temp);
     return $return_data;
 }
开发者ID:hazbo,项目名称:simpletags,代码行数:45,代码来源:SimpleTag.php


示例15:

 /**
  *    Starts with a named tag with attributes only.
  *    @param hash $attributes    Attribute names and
  *                               string values.
  */
 function __construct($attributes)
 {
     parent::__construct('frame', $attributes);
 }
开发者ID:sebs,项目名称:simpletest,代码行数:9,代码来源:tag.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SimpleTest类代码示例发布时间:2022-05-23
下一篇:
PHP SimpleStackTrace类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap