本文整理汇总了PHP中ns函数的典型用法代码示例。如果您正苦于以下问题:PHP ns函数的具体用法?PHP ns怎么用?PHP ns使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ns函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ?: []);
}
开发者ID:rommelsantor,项目名称:RawMVC,代码行数:14,代码来源:controller.php
示例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'));
}
开发者ID:Shelob9,项目名称:eight-day-week,代码行数:22,代码来源:core.php
示例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
开发者ID:seavagabond,项目名称:demo-rwd-7x,代码行数:31,代码来源:page.tpl.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;
开发者ID:davidclarkmoore,项目名称:vintage-enoteca,代码行数:31,代码来源:page.tpl.php
示例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
开发者ID:rmontero,项目名称:dla_ecommerce_site,代码行数:31,代码来源:page.tpl.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
开发者ID:BernieCram,项目名称:drupalmel,代码行数:31,代码来源:page.tpl.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;
开发者ID:maduhu,项目名称:opengovplatform-alpha,代码行数:31,代码来源:page-sample.tpl.php
示例8: a
function a($function)
{
add_action($function, ns($function));
}
开发者ID:Shelob9,项目名称:eight-day-week,代码行数:4,代码来源:admin-menu-page.php
示例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;
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:31,代码来源:setup.php
示例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
开发者ID:KyleAMathews,项目名称:dewey,代码行数:31,代码来源:page.tpl.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
开发者ID:vagrantscholar,项目名称:zen_ninesixty,代码行数:31,代码来源:page.tpl.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;
}
开发者ID:rommelsantor,项目名称:RawMVC,代码行数:38,代码来源:kernel.php
示例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>
开发者ID:rollinsb1010,项目名称:bbcom,代码行数:30,代码来源:page-embed-reader-remote.tpl.php
示例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);
}
开发者ID:assertchris,项目名称:yay,代码行数:9,代码来源:ParserTest.php
示例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
}
?>
开发者ID:javaperl,项目名称:fcase,代码行数:29,代码来源:page.tpl.php
示例16: 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-4 <?php
print ns('pull-12', $right, 3);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<?php
if ($right) {
?>
<div id="sidebar-right" class="column sidebar region grid-3">
<?php
开发者ID:rmontero,项目名称:dla_ecommerce_site,代码行数:31,代码来源:page.tpl.php
示例17: 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-3 <?php
print ns('pull-13', $page['sidebar_second'], 5);
?>
">
<?php
print render($page['sidebar_first']);
?>
</div>
<?php
}
?>
<?php
if ($page['sidebar_second']) {
?>
<div id="sidebar-right" class="column sidebar region grid-5">
<?php
开发者ID:niswebsolutions,项目名称:baitball.com,代码行数:31,代码来源:page.tpl.php
示例18: dynamic_region_builder
/**
* The dynamic_region_builder function will be used to pass important zones
* like the content regions where the regions sent to the function MUST appear
* inline, and advanced calculations need to be done in order to display the as such
*
* Stacked regions are not possible using this function, and should be passed through
* static_region_builder() instead.
*/
function dynamic_region_builder($region_data, $container_width, $vars) {
// let's cycle the region data, and determine what we have
foreach ($region_data AS $region => $info) {
// if we do have content for this region, let's create it.
if (isset($info['data'])) {
if (isset($info['primary'])) {
$width = $container_width;
$vars[$region . '_classes'] = ns('grid-' . _omega_dynamic_widths($width, $info['related'], $vars));
}
else {
$width = $info['width'];
$vars[$region . '_classes'] = ns('grid-' . $info['width']);
}
// we know we have stuff to put here, so we can check for push & pull options
if ($info['pull']) {
// looks like we do wanna pull, or this value would have been false, so let's boogie
$vars[$region . '_classes'] .= ' ' . ns('pull-' . _omega_dynamic_zones($info['pull']['width'], $info['pull']['conditions'], $vars));
}
if ($info['push']) {
// looks like a push
$vars[$region . '_classes'] .= ' ' . ns('push-' . _omega_dynamic_zones($info['push']['width'], $info['push']['conditions'], $vars));
}
}
// currently ignored becuase we have not given prefix/suffix class options
// to the primary content zones... this will become active again later
if (isset($info['spacing'])) {
foreach ($info['spacing'] AS $attribute => $value) {
if ($value) {
$vars[$region . '_classes'] .= ' ' . $attribute . '-' . $value;
}
}
}
// \unused prefix/suffix stuffs
}
return $vars;
}
开发者ID:nicolasnm,项目名称:divingbook,代码行数:44,代码来源:template.php
示例19: ns
</div> <!-- /#main-content -->
<?php
print $feed_icons;
?>
</div> <!-- // #content-inner -->
</div> <!-- //#content -->
<?php
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-4 <?php
print ns('pull-12');
?>
">
<div id="sidebar-left-inner">
<?php
print $left;
?>
</div>
</div> <!-- //end #sidebar-left-inner -->
<?php
}
?>
<?php
if ($right && $is_front) {
?>
开发者ID:aakb,项目名称:Urban-media-space,代码行数:31,代码来源:page-taxonomy-term.tpl.php
示例20: ns
if ($left) {
?>
<div id="sidebar-left" class="column sidebar region grid-2 <?php
print ns('pull-8', !$right, 2);
?>
">
<?php
print $left;
?>
</div>
<?php
}
?>
<div id="sidebar-right" class="column sidebar region <?php
print ns('grid-4', $left, 2);
?>
">
<?php
print $right;
?>
</div>
</div>
<div id="footer-wrapper">
<div id="footer" class="container-12 prefix-1 suffix-1">
<div id="copyright">Copyright © 2010, 2011 Lingwo International</div>
<?php
if ($footer) {
?>
<div id="footer-region" class="region grid-10 clear-block">
开发者ID:rollinsb1010,项目名称:bbcom,代码行数:31,代码来源:page.tpl.php
注:本文中的ns函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论