本文整理汇总了PHP中SimpleTag::setof方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleTag::setof方法的具体用法?PHP SimpleTag::setof怎么用?PHP SimpleTag::setof使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTag
的用法示例。
在下文中一共展示了SimpleTag::setof方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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');
}
示例3: 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;
}