本文整理汇总了PHP中ns函数的典型用法代码示例。如果您正苦于以下问题:PHP ns函数的具体用法?PHP ns怎么用?PHP ns使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ns函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse_post
/**
*
*/
private function parse_post()
{
if (@$_SERVER['REQUEST_METHOD'] != 'POST') {
$this->pd = (object) [];
$this->fd = (object) [];
return;
}
$_POST = array_map(ns('stripslashes_deep'), $_POST);
$this->pd = (object) @$_POST;
$this->fd = (object) (@$_FILES ?: []);
}
示例2: setup
/**
* Default setup routine
*
* @uses add_action()
* @uses do_action()
*
* @return void
*/
function setup()
{
function ns($function)
{
return __NAMESPACE__ . "\\{$function}";
}
add_action('init', ns('init'));
add_action(__NAMESPACE__ . '\\init', ns('i18n'));
//activate current version of this plugin
add_action('admin_init', ns('activate'));
do_action(__NAMESPACE__ . '\\loaded');
//add data to wp_send_json_*
add_filter('pp-ajax-data', ns('tack_on_ajax_response'));
}
示例3: render
<div id="main-content" class="region clearfix">
<?php
print render($page['content']);
?>
</div>
<?php
print $feed_icons;
?>
</div>
<?php
if ($page['sidebar_first']) {
?>
<div id="sidebar-left" class="column sidebar region grid-4 <?php
print ns('pull-12', $page['sidebar_second'], 3);
?>
">
<?php
print render($page['sidebar_first']);
?>
</div>
<?php
}
?>
<?php
if ($page['sidebar_second']) {
?>
<div id="sidebar-right" class="column sidebar region grid-3">
<?php
示例4: elseif
$main_sidebar_adjust_outer = "";
$main_sidebar_adjust_inner = "";
} elseif ($left) {
$main_sidebar_adjust_outer = "omega";
$main_sidebar_adjust_inner = "container-padding-right";
} elseif ($right) {
$main_sidebar_adjust_outer = "alpha";
$main_sidebar_adjust_inner = "container-padding-left";
} else {
$main_sidebar_adjust_outer = "alpha omega";
$main_sidebar_adjust_inner = "container-padding-left container-padding-right";
}
?>
<div id="main" class="column <?php
print ns('grid-16', $left, 3, $right, 4) . ' ' . $main_sidebar_adjust_outer;
?>
">
<div id="main-inner" class="<?php
print $main_sidebar_adjust_inner;
?>
" >
<?php
if ($tabs) {
?>
<?php
$path = explode('/', drupal_get_path_alias($_GET['q']));
if ($path[0] != 'job-seeker') {
?>
<div class="tabs"><?php
print $tabs;
示例5: ns
print $content_top;
?>
<?php
print $content;
?>
<?php
print $content_bottom;
?>
</div>
</div>
<?php
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-4 <?php
print ns('pull-12', $right, 4);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<?php
if ($right) {
?>
<div id="sidebar-right" class="column alpha sidebar region grid-4">
<?php
示例6: ns
<div id="main-content" class="region clear-block">
<?php
print $content;
?>
</div>
<?php
print $feed_icons;
?>
</div>
<?php
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-3 <?php
print ns('pull-13', $right, 3);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<?php
if ($right) {
?>
<div id="sidebar-right" class="column sidebar region grid-3">
<?php
示例7: ns
<?php
print $help;
?>
<?php
print $content;
?>
</div>
<?php
print $feed_icons;
?>
</div>
<?php
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-2 <?php
print ns('pull-10', $right, 3);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<?php
if ($right) {
?>
<div id="sidebar-right" class="column sidebar region grid-3">
<?php
print $right;
示例8: a
function a($function)
{
add_action($function, ns($function));
}
示例9: fwrite
</center><br /><div style="font-size: 10px;">Powered by <a href="http://www.bigprof.com/appgini/" target=_blank>BigProf AppGini 4.52</a></div>
</div>
</form>
<?php
exit;
} else {
// if connection is successful, save parameters into config.php
if (!($fp = @fopen("./config.php", "w"))) {
echo $divFormat . "<div style=\"color: red;\">" . $Translation["couldnt save config"] . "</div></div><br />";
echo $backHome;
exit;
} else {
fwrite($fp, "<?php\n");
fwrite($fp, "\t\$dbServer='" . ns($dbServer) . "';\n");
fwrite($fp, "\t\$dbUsername='" . ns($dbUsername) . "';\n");
fwrite($fp, "\t\$dbPassword='" . ns($dbPassword) . "';\n");
fwrite($fp, "\t\$dbDatabase='" . ns($dbDatabase) . "';\n");
fwrite($fp, "?>");
fclose($fp);
}
}
$silent = false;
include "{$d}/updateDB.php";
if ($setupAlreadyRun) {
echo "{$divFormat} {$Translation['setup performed']} " . @date('r', filemtime(dirname(__FILE__) . '/setup.md5')) . '<br /><br /></div>';
echo "{$divFormat}<div style=\"font-size: 10px;\">" . $Translation["delete md5"] . "</div></div><br /><br />";
echo $backHome;
exit;
}
// go to index
echo $backHome;
示例10: ns
?>
</div>
<span class="grid-1 prefix-1">
<?php
print $feed_icons;
?>
</span>
</div>
<?php
if ($left) {
?>
<div id="sidebar-left" class="sidebar grid-4 <?php
print ns('pull-11', $right, 3);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<div id="sidebar-right" class="sidebar grid-4">
<?php
if ($right) {
?>
<?php
示例11: ns
<?php
print $navigation;
?>
</div></div> <!-- /.section, /#navigation -->
<?php
}
?>
</div></div> <!-- /#main, /#main-wrapper -->
<?php
if ($sidebar_first) {
?>
<div id="sidebar-first" class="column sidebar region grid-4 <?php
print ns('pull-12', $sidebar_second, 3);
?>
">
<?php
print $sidebar_first;
?>
</div>
<?php
}
?>
<?php
if ($sidebar_second) {
?>
<div id="sidebar_second" class="column sidebar region grid-3">
<?php
示例12: control_request
/**
*
*/
private function control_request($i_controllerName, $i_action, array $i_params)
{
$filename_prefix = str_replace('-', '', $i_controllerName);
$class_prefix = str_replace('-', '', $i_controllerName);
if (!self::has_controller($filename_prefix)) {
self::error_404('Controller not loaded');
}
$controller_class = ns($class_prefix . 'Controller');
$controller = new $controller_class($i_action, $i_params);
if (!$controller->is_valid_action($i_action)) {
if ($i_action != 'index') {
array_unshift($i_params, $i_action);
$i_action = 'index';
$controller = new $controller_class($i_action, $i_params);
} else {
self::error_404('Invalid action requested');
}
}
$result = $controller->_call_action($i_action, $i_params);
if (is_array($result)) {
header('Content-Type: application/json');
die(json_encode($result));
}
if (!self::load('view/' . $filename_prefix . '.php')) {
return $result;
}
$view_class = ns($class_prefix . 'View');
$view = new $view_class($controller);
$output = $view->render();
if ($output === false) {
self::error_404('View rendered blank');
}
echo $output;
exit;
}
示例13: ns
if ($linked_logo_img) {
print ' prefix-1';
}
?>
">
<?php
print $main_menu_links;
?>
</div>
<?php
}
?>
<!-- Replace language switch with return link -->
<div id="language-switcher" class="grid-3 <?php
print ns('prefix-9', $main_menu_links, 9);
?>
">
<a href="javascript:window.history.back();"><?php
print t('Return to BiblioBird');
?>
>></a>
</div>
</div>
</div>
<?php
print $content;
?>
</div>
示例14: testNamespace
/**
* @dataProvider providerForTestNamespace
*/
function testNamespace(string $src, string $expected)
{
$ts = TokenStream::fromSource($src);
$this->parseSuccess($ts, token(T_OPEN_TAG), "T_OPEN_TAG(<?php )");
$this->parseSuccess($ts, ns(), $expected);
}
示例15: ns
<?php
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-4">
<?php
print $left;
?>
</div>
<?php
}
?>
<div id="main" class="column <?php
print ns('grid-16', $left, 4, $right, 3);
?>
">
<?php
print $breadcrumb;
?>
<?php
if ($title) {
?>
<h1 class="title" id="page-title"><?php
print $title;
?>
</h1>
<?php
}
?>