本文整理汇总了PHP中template::inc方法的典型用法代码示例。如果您正苦于以下问题:PHP template::inc方法的具体用法?PHP template::inc怎么用?PHP template::inc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template
的用法示例。
在下文中一共展示了template::inc方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
function home()
{
$manager = new manager();
$url = "?mod=index&page=_page_";
if ($key = get($_GET, 'key')) {
$where = util::convert($_GET['field']) . ' like "%' . util::convert($key) . '%"';
$manager->db->where($where);
$url = sprintf('%s&fields=%s&key=%s', $url, $_GET['field'], $key);
}
if ($cnt = $manager->db->count()) {
$o = array('size' => 20);
//每页显示的记录数
$pages = new pages($cnt, $o);
$sql = sprintf("select * from %s %s order by id desc", $manager->db->table, $manager->db->condition());
$rows = $manager->db->rows($sql, $pages->start, $o['size']);
$nav = $pages->show();
}
include template::inc("manager/index.php");
}
示例2:
?>
</div>
<div style="float:left; border: 1px solid black; padding: 3px; background-color: #F8F8F8">
<textarea id="code" cols="120" rows="30">
<?php
$test = "test";
echo $test;
?>
</textarea>
</div>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea('code', {
height: "350px",
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
"../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
"../contrib/php/js/parsephphtmlmixed.js"],
stylesheet: ["/lib/CodeMirror-0.93/css/xmlcolors.css", "/lib/CodeMirror-0.93/css/jscolors.css", "/lib/CodeMirror-0.93/css/csscolors.css", "/lib/CodeMirror-0.93/contrib/php/css/phpcolors.css"],
path: "/lib/CodeMirror-0.93/js/",
continuousScanning: 500,
lineNumbers: true
});
</script>
<?php
template::inc('global', 'bottom');
示例3: array
<?php
$title = "Blog Listing";
template::inc('intranet', 'top');
?>
<div class = "has-floats">
<div class = "float-right blog_listing">
<div class = "content_listing">
<input type = "button" onclick = "window.location = '/admin/blog/blogs/add-new'" value = "Add new blog"/>
<?php
$cols = "\t\n\t\t\tname\t\t{label:\tName\t\t;}\n\t\t\tdescription\t{label:\tDescription\t;}\n slug {label: Slug \t\t;}\n status\t\t{label: Status\t\t;}\n\t\t";
if (auth('blog_author:editor')) {
$cols .= 'edit {}';
}
$clause = array('blog_website' => array('where' => 'blog_website.website_id=' . $website_id));
$param = array('enable_sort' => true);
$params = array("aql" => 'blog', 'clause' => $clause, "cols" => $cols, "param" => $param);
aql::grid($params);
?>
</div>
</div>
<div class = "left_nav">
<?php
include 'pages/admin/blog/left-nav/left-nav.php';
?>
</div>
</div>
<?php
template::inc('intranet', 'bottom');
示例4: get_codebases
<?php
$title = 'Codebase Editor';
template::inc('skybox', 'top');
$selected_codebase = $_GET['codebase'];
$table = $_GET['table'];
$codebase_list = get_codebases();
$codebase_arr = array();
$aql = "dev_codebase\t{\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}";
$codebase_arr = array();
$rs = aql::select($aql);
foreach ($rs as $r) {
$codebase_arr[$r['name']] = $r['name'];
}
foreach ($codebase_list as $codebase) {
$codebase_arr[$codebase['codebase']] = $codebase['codebase'];
}
$param = array('id' => 'codebase_name', 'name' => 'name', 'selected_value' => $selected_codebase);
snippet::dropdown($codebase_arr, $param);
?>
<br><br>
<div>
<input type="hidden" id = "table_name" value = "<?php
echo $table;
?>
" />
<input type="submit" value="Save" onclick = "save_codebase()" />
</div>
<?php
template::inc('skybox', 'bottom');
示例5: info
/**
** 掷出信息
** @ info : 信息内容
** @ url : 重定向url
**/
public static function info($url = 'none', $info = '', $type = 'ok', $second = 2, $title = "提示信息")
{
$info = empty($info) ? '操作成功!' : (is_string($info) ? $info : json_encode($info));
include_once template::inc('msg.html');
exit;
}
示例6:
<?php
$blog_article_ide = IDE;
$r = aql::profile('blog_article', $blog_article_ide);
$title = $r['title'];
template::inc('website', 'top');
include 'components/blog_article/id/article.php';
template::inc('website', 'bottom');
示例7: foreach
//添加页
$tr = $tr == 'tr' ? 'tr2' : 'tr';
foreach ($_POST[$v] as $key => $val) {
$fields .= "<tr class='{$tr} h30'>\n<td class='ltit'>{$_POST['field'][$key]}</td>\n<td><input name='{$key}' type='text'></td>\n</tr>\n";
}
$str = str_replace(array('__table__', '__ds_table__', '__fields__'), array($table, $ds_table, $fields), $str);
} else {
if ('edit' == $v) {
//编辑页
$tr = $tr == 'tr' ? 'tr2' : 'tr';
foreach ($_POST[$v] as $key => $val) {
$fields .= "<tr class='{$tr} h30'>\n<td class='ltit'>{$_POST['field'][$key]}</td>\n<td><input name='{$key}' value=\"{\$row['{$key}']}\" type='text'></td>\n</tr>\n";
}
$str = str_replace(array('__table__', '__ds_table__', '__fields__'), array($table, $ds_table, $fields), $str);
}
}
}
file::save($mod, $str);
}
}
/** 显示所有的数据表 **/
foreach ($db->query('show tables') as $row) {
$tables[] = $row[0];
}
$table = in_array($table, $tables) ? $table : $tables[0];
/** 显示一个表中的所有字段 */
foreach ($db->query('show full COLUMNS from ' . $table) as $row) {
$rows[] = $row;
}
include template::inc('tools/index.php');