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

PHP helper函数代码示例

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

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



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

示例1: test_call

 public function test_call()
 {
     $this->set_prefix('caller');
     $caller = call();
     $this->test(1, $caller, 'Instance create');
     $this->test(2, call() === $caller, 'Instance retrieval');
     $this->set_prefix('helpers');
     $this->test(1, function_exists('test_useful_test'));
     helper('__useful_test');
     $this->test(2, function_exists('test_useful_test'));
     $this->test(3, test_useful_test());
     $this->test(4, test_useful_test_again());
     $this->test(5, function_exists('test_useful_sub_test_advanced'));
     helper('__useful_sub_test');
     $this->test(6, test_useful_sub_test_advanced());
     $this->set_prefix('do_call');
     $this->test(1, call('__useful_test::get_caller_module_path'));
     $this->test(2, call('__useful_test'));
     $this->test(3, call('__useful_test_again'));
     $this->test(4, call('__useful_sub_test_advanced'));
     $this->set_prefix('direct');
     $this->test(1, call()->__useful_test());
     $this->test(2, call()->__useful_sub_test_advanced());
     $this->test(3, call()->__useful_test->get_caller_module_path());
     $this->test(4, call()->__useful_same->test());
     $this->set_prefix('exception');
     $this->exception_test(1, 'exception_invalid_caller');
 }
开发者ID:rentalhost,项目名称:core,代码行数:28,代码来源:core_caller.php


示例2: helper

function helper($element)
{
    if ($element instanceof DOMText) {
        return htmlspecialchars($element->nodeValue);
    } else {
        $body = '';
        foreach ($element->childNodes as $child) {
            $body .= helper($child);
        }
        if ($element instanceof DOMElement) {
            $attrs = array();
            foreach ($element->attributes as $attr) {
                $attrs[] = htmlspecialchars($attr->name) . '="' . htmlspecialchars($attr->value) . '"';
            }
            if ($attrs) {
                $attrs = ' ' . implode(' ', $attrs);
            } else {
                $attrs = '';
            }
            return '<' . $element->tagName . $attrs . '>' . $body . '</' . $element->tagName . '>';
        } else {
            return $body;
        }
    }
}
开发者ID:badlamer,项目名称:hhvm,代码行数:25,代码来源:1677.php


示例3: postIndex

 public function postIndex(Request $request)
 {
     if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) {
         return redirect(helper()->urlBackend('/'));
     } else {
         return redirect()->back()->withInput()->withError('Login Failed , Check Your Password or Username');
     }
 }
开发者ID:oblagiolabs,项目名称:core,代码行数:8,代码来源:LoginController.php


示例4: helper

function helper($model, $left, $right)
{
    $middle = $model->get_middle($left[NODE_ID], $right[NODE_ID]);
    if ($middle != NULL) {
        helper($model, $left, $middle[NODE_ID]);
        render($middle, $left);
        helper($model, $middle[NODE_ID], $right_);
    }
}
开发者ID:RichardFish,项目名称:d-ROC,代码行数:9,代码来源:constgraph.php


示例5: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $action = helper()->segmentAction();
     $right = helper()->getRight($action);
     if ($right == 'true' || $right == 'go') {
         return $next($request);
     } else {
         return redirect('401');
     }
 }
开发者ID:oblagiolabs,项目名称:core,代码行数:17,代码来源:Right.php


示例6: __construct

 function __construct()
 {
     helper('string');
     $this->ChannelUnit = new ChannelUnit(intval($this->ChannelID));
     if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) {
         $this->MainTable = '#@__archives';
     } else {
         $this->MainTable = $this->ChannelUnit->ChannelInfos['addtable'];
     }
 }
开发者ID:CMS-CHINA,项目名称:secondary-development-of-Dedecms,代码行数:10,代码来源:baiduxml.class.php


示例7: buildjson

function buildjson($curr)
{
    global $id;
    $result = mysql_query("SELECT * FROM  `{$id}` WHERE  `ID` = {$curr}");
    if (!$result) {
        die(mysql_error());
    }
    $row = mysql_fetch_array($result);
    $tmp = '{id:\\"' . $row['ID'] . '\\",name:\\"' . $row['Title'] . '\\",data:{$color:\\"' . ncolor($row['rNum'], $row['rTotal']) . '\\",$author:\\"' . $row['Author'] . '\\", $content:\\"' . $row['Content'] . '\\"},children:[' . helper($curr) . ']}';
    return $tmp;
}
开发者ID:ruiiiijiiiiang,项目名称:CS292-Project,代码行数:11,代码来源:var.php


示例8: helper

function helper($model, $left, $right)
{
    global $graphstr;
    $middle = $model->get_middle($left[NODE_ID], $right[NODE_ID]);
    if ($middle != NULL) {
        #echo $left[NODE_CONTENT] . "<br/>";
        #echo $middle[NODE_CONTENT] . "<br/>";
        #echo $right[NODE_CONTENT] . "<br/><br/>";
        render($middle[NODE_CONTENT], $left[NODE_CONTENT]);
        helper($model, $left, $middle);
        helper($model, $middle, $right);
    }
}
开发者ID:RichardFish,项目名称:d-ROC,代码行数:13,代码来源:graph.php


示例9: getDelete

 public function getDelete($id)
 {
     $model = $this->model->find($id);
     if (!empty($model->id)) {
         try {
             $model->delete();
             return redirect(helper()->urlAction() . '/index')->withSuccess('Data has been deleted');
         } catch (\Exception $e) {
             return redirect(helper()->urlAction() . '/index')->withSuccess('Data Cannot be deleted');
         }
     } else {
         return redirect('404');
     }
 }
开发者ID:oblagiolabs,项目名称:core,代码行数:14,代码来源:UserController.php


示例10: helper

function helper($root, $target, &$path, &$result)
{
    if ($root == null) {
        return;
    }
    if ($root->left == null && $root->right == null) {
        if ($root->val == $target) {
            $path[] = $root->val;
            $result[] = $path;
            array_pop($path);
        }
        return;
    }
    $path[] = $root->val;
    helper($root->left, $target, $path, $result);
    helper($root->right, $target, $path, $result);
    array_pop($path);
}
开发者ID:braydenxu,项目名称:code-review,代码行数:18,代码来源:FileManager.php


示例11: longestPalindrome

function longestPalindrome($s)
{
    print $s;
    if ($s == "") {
        return;
    }
    if (strlen($s) == 1) {
        return $s;
    }
    $longest = substr($s, 0, 1);
    for ($i = 0; $i < strlen($s); $i++) {
        $tmp = helper($s, $i, $i);
        if (strlen($tmp) > strlen($longest)) {
            $longest = $tmp;
        }
        $tmp = helper($s, $i, $i + 1);
        if (strlen($tmp) > strlen($longest)) {
            $longest = $tmp;
        }
    }
    print $longest;
}
开发者ID:sifxtreme,项目名称:php-coding-exercises,代码行数:22,代码来源:longest_palindrome.php


示例12: getFormvalidation

 public function getFormvalidation()
 {
     $inputs = Input::all();
     $model = $inputs['model'];
     $unique_id = $inputs['unique_id'];
     unset($inputs['model']);
     unset($inputs['unique_id']);
     $modelFix = helper()->injectModel($model);
     if (!$modelFix->messages) {
         $messages = [];
     } else {
         $messages = $modelFix->messages;
     }
     $validation = Validator::make($inputs, $modelFix->rules($unique_id), $messages);
     if ($validation->fails()) {
         $status = 'fails';
         $errors = $validation->getMessageBag()->toArray();
     } else {
         $status = 'true';
         $errors = '';
     }
     return \Response::json(['status' => $status, 'errors' => $errors]);
 }
开发者ID:oblagiolabs,项目名称:core,代码行数:23,代码来源:BackendController.php


示例13: array

?>
                        </td>
                    <? endif; ?>
                    <td>
                        <?php 
echo $debate->created_by_name;
?>
                    </td>
                    <td>
                        <?php 
echo @helper('date.humanize', array('date' => $debate->created_on));
?>
                    </td>
                    <td>
                        <?php 
echo @helper('grid.order', array('row' => $debate, 'total' => $total));
?>
                    </td>
                    <td>
                        <?php 
echo $debate->id;
?>
                    </td>
                </tr>
            <? endforeach; ?>

            <? if (!count($debates)) : ?>
                <tr>
                    <td colspan="10" align="center" style="text-align: center;">
                        <?php 
echo @text('NO_ITEMS');
开发者ID:kedweber,项目名称:com_debates,代码行数:31,代码来源:default.php


示例14: foreach

	<? foreach ($contacts as $contact) : ?>
		<tr>
			<td width="20" align="center">
				<?= @helper('grid.checkbox', array('row' => $contact))?>
			</td>				
			<td align="left">
				<a href="<?= @route('view=contact&id='.$contact->id); ?>">
	   				<?= @escape($contact->name); ?>
	   			</a>
			</td>
			<td align="center">
				<?= @helper('grid.enable', array('row' => $contact)); ?>
            </td>
			<td align="center">
				<?= @helper('grid.order', array('row' => $contact)); ?>
			</td>
			<td align="center">
				<?= @helper('grid.access', array('row' => $contact)) ?>
			</td>
			<td align="left">
				<?  if($contact->user_id) : ?>
				    <a href="<?= @route('option=com_users&view=user&id='.$contact->user_id) ?>">
				       <?= $contact->username; ?>
					</a>
				<? endif; ?>
			</td>
		</tr>
	<? endforeach; ?>
	</tbody>	
</table>
</form>
开发者ID:raeldc,项目名称:com_learn,代码行数:31,代码来源:default.php


示例15: array

<?php 
echo @helper('behavior.validator');
?>

<script src="media://lib_koowa/js/koowa.js" />
<style src="media://lib_koowa/css/koowa.css" />

<form action="" method="post" class="-koowa-form" id="group-form">
    <div class="grid_8">
        <div class="panel title group">
            <input class="inputbox required" type="text" name="name" id="title" size="40" maxlength="255" value="<?php 
echo $group->name;
?>
" placeholder="<?php 
echo @text('Name');
?>
" />
        </div>
        
        <div class="panel">
            <h3><?php 
echo @text('Group');
?>
</h3>
        	<?php 
echo @helper('select.groups', array('name' => 'target_id', 'selected' => $group->parent_id, 'exclude' => $group));
?>
       	</div>
    </div>
</form>
开发者ID:raeldc,项目名称:nooku-server,代码行数:30,代码来源:form.php


示例16: defined

<?php

/**
 * @version     $Id: module.php 632 2011-03-20 14:28:45Z cristiano.cucco $
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Banners
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */
defined('KOOWA') or die('Restricted access');
?>

<ul class="module-events">
<? foreach ($events as $event) : ?>
	<li><?php 
echo $event->title;
?>
<br /><small><?php 
echo @helper('date.humanize', array('date' => $event->start_date));
?>
</small></li>
<? endforeach ?>
</ul>
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:25,代码来源:default.php


示例17: translate

<? // Download count field ?>
<div class="koowa_grid__row">
    <div class="control-group koowa_grid__item one-whole">
        <label class="control-label"><?= translate('Downloads'); ?></label>
        <div class="controls" id="hits-container">
            <p class="help-inline">
                <?= $document->hits; ?>
            </p>
            <? if ($document->hits): ?>
                <a href="#" class="btn btn-default btn-small"><?= translate('Reset'); ?></a>
            <? endif; ?>
        </div>
    </div>
</div>

<? // Modified by field ?>
<? if ($document->modified_by): ?>
<div class="koowa_grid__row">
    <div class="control-group koowa_grid__item one-whole">
        <label class="control-label"><?= translate('Modified by'); ?></label>
        <div class="controls">
            <span class="help-info">
            <?= object('user.provider')->load($document->modified_by)->getName(); ?>
            <?= translate('on') ?>
            <?= helper('date.format', array('date' => $document->modified_on)); ?>
            </span>
        </div>
    </div>
</div>
<? endif; ?>
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:form_audit.html.php


示例18: translate

    }
    ?>
                    <?php 
    if ($page->hidden) {
        ?>
                        <span class="label label-info"><?php 
        echo translate('Hidden');
        ?>
</span>
                    <?php 
    }
    ?>
                </td>
                <td align="center">
                    <?php 
    echo helper('grid.order', array('row' => $page, 'total' => $total));
    ?>
                </td>
                <td>
                    <?php 
    echo $page->getTypeDescription();
    ?>
                </td>
            </tr>
            <?php 
}
?>
        </tbody>
    </table>
</form>
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:30,代码来源:default.html.php


示例19: array

    ?>
</span> 
				
				<?php 
    if ($item->isLeadable()) {
        ?>
				/ <?php 
        echo $item->leaderCount;
        ?>
				<span class="stat-name"><?php 
        echo @text('COM-ACTORS-SOCIALGRAPH-LEADERS');
        ?>
</span>
				<?php 
    }
    ?>
				</div>
			
			</div>
		</div>

		<div class="entity-description">
			<?php 
    echo @helper('text.truncate', @content($item->body, array('exclude' => array('syntax', 'video'))), array('consider_html' => true, 'length' => 150));
    ?>
		</div>
	</div>
<?php 
}
?>
</div>
开发者ID:walteraries,项目名称:anahita,代码行数:31,代码来源:badge.php


示例20: array

echo @template('form_accordion', array('params' => $module->params, 'id' => 'param-page', 'title' => 'Module Parameters'));
?>

		<? if($module->params->getNumParams('advanced')) : ?>
		<?php 
echo @template('form_accordion', array('params' => $module->params, 'group' => 'advanced'));
?>
		<? endif ?>
	
		<? if($module->params->getNumParams('other')) : ?>
		<?php 
echo @template('form_accordion', array('params' => $module->params, 'group' => 'other'));
?>
		<? endif ?>
	<?php 
echo @helper('accordion.endPane');
?>
</div>
<div class="clr"></div>

<? if(!$module->type || $module->type == 'custom' || $module->type == 'mod_custom') : ?>
<fieldset class="adminform">
	<legend><?php 
echo @text('Custom Output');
?>
</legend>
	
	<?php 
echo @editor(array('name' => 'content', 'content' => @escape($module->content), 'height' => 400, 'cols' => 60, 'buttons' => array('pagebreak', 'readmore')));
?>
</fieldset>
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:31,代码来源:form.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP helper_alternate_class函数代码示例发布时间:2022-05-15
下一篇:
PHP helpbutton函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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