本文整理汇总了PHP中core::prepend方法的典型用法代码示例。如果您正苦于以下问题:PHP core::prepend方法的具体用法?PHP core::prepend怎么用?PHP core::prepend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core
的用法示例。
在下文中一共展示了core::prepend方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: label
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<?php
echo core::prepend('head');
?>
</head>
<body>
<?
$c= cms::context();
$c-> label('Test if data files writable') -> icon('offline_pin') -> popup(core::url('test-files'));
$c-> label('To ConKit project page') -> icon('cloud') -> url("https://github.com/stanpro/conkit");
echo cms::anchorGlobal($c);
?>
<fieldset>
<legend>Header (see head.tpl.php)</legend>
<div>
<img src="logo.png" style="width:100px; vertical-align:middle; margin-right:2em; margin-left:3em;">
<a href="<?php
echo cms::loginUrl();
?>
">Login</a>
</div>
</fieldset>
<fieldset style="padding:3em;">
<legend>Body template (see <?php
echo core::moduleName();
?>
.tpl.php)</legend>
示例2: perform
<?
if (cms::admin()) core::prepend('head','cms');
class cms
{
//=============================================================================
// internal CMS perfomance
static function perform()
{
if (core::req('cms-oper')=='logout')
{
if (isset($_SESSION)) unset($_SESSION['.cms-admin']);
if (!isset($_SESSION) || count($_SESSION)==0) setcookie(session_name(),'',0,'/');
setcookie('conkit_cms_exp',core::$req['.cms-admin']['name'],0,'/');
core::halt(302,urldecode(core::req('cms-request')));
}
elseif (core::req('cms-oper')=='login') cms::login();
}
//=============================================================================
static function login()
{
core::reg('run-naked',true);
$realm= core::config('cms-realm');
if (!$realm)
{
$realm= strtolower($_SERVER['HTTP_HOST']);
if (substr($realm,0,4)=='www.') $realm= substr($realm,4);
$realm= 'ConKit@'.$realm;
示例3: label
<? core::prepend('head','title','CMS\'ed page - ConKit test') ?>
<?
$c= cms::context() -> label('Edit') -> icon('edit') -> popup(core::url('edit-block','no',1)) -> popuptitle('Edit text block 1');
echo cms::anchor($c,'Block 1');
?>
<div>
<h1><?php
echo core::vars('headline1');
?>
</h1>
<h2><?php
echo core::vars('subheadline1');
?>
</h2>
<?
$c= cms::context();
$c-> label('Upload new image') -> icon('file_upload') -> popup(core::url('upload-image'));
if (core::req('.hide-image')) $c-> label('Unhide image') -> icon('visibility_on') -> url(core::url('upload-image','cms-form-action','unhide'));
else $c-> label('Hide image') -> icon('visibility_off') -> url(core::url('upload-image','cms-form-action','hide'));
echo cms::anchor($c);
?>
<div style="float:right;">
<? if (!core::req('.hide-image')): ?>
<img src="sample.jpg" style="max-width:400px; margin-left:2em;">
<? endif ?>
</div>
<?php
echo core::vars('text1');
示例4: prepend
static function prepend($target,$type='(output)',$value=null)
{
if ($type=='(output)')
{
if (core::cms()) core::prepend('head','cms');
$html= "\n";
if (isset(core::$prepend[$target])) foreach (core::$prepend[$target] as $value) $html.= $value."\n";
unset(core::$prepend[$target]);
return $html;
}
elseif ($type=='title') $value= '<title>'.$value.'</title>';
elseif ($type==='description') $value= '<meta name="description" content="'.$value.'" />';
elseif ($type==='keywords') $value= '<meta name="keywords" content="'.$value.'" />';
elseif ($type==='charset') $value= '<meta http-equiv=Content-Type content="text/html; charset='.$value.'" />';
elseif ($type==='favicon') $value= '<link rel="shortcut icon" href="'.$value.'" />';
elseif ($type=='jquery') $value= '<script type="text/javascript" src="'.core::config('jquery').'"></script>';
elseif ($type=='alert') $value= '<script type="text/javascript">Alert("'.addslashes($value).'")</script>';
elseif ($type==='cms')
{
core::prepend('head','jquery');
core::prepend('head','css','?core-module=cms-resource&file=cms.css');
core::prepend('head','js','?core-module=cms-resource&file=cms.js');
core::prepend('head','css','https://fonts.googleapis.com/icon?family=Material+Icons');
return;
}
elseif ($type==='js')
{
$type= $value;
$value= '<script type="text/javascript" src="'.$value.'"></script>';
}
elseif ($type==='css')
{
$type= $value;
$value= '<link rel="stylesheet" type="text/css" href="'.$value.'" />';
}
elseif ($type=='script')
{
$type= null;
$value= '<script>'.$value.'</script>';
}
elseif ($type=='alert')
{
$type= null;
$value= '<script>alert("'.$value.'");</script>';
}
elseif (!$value)
{
$value= $type;
$type= null;
}
if ($type) core::$prepend[$target][$type]= $value;
else core::$prepend[$target][]= $value;
}
示例5:
<? core::prepend('head','title','Home page - ConKit test') ?>
<h1>Hello world</h1>
This is basic sample page.
示例6: foreach
<? core::prepend('head','title','Another page - ConKit test') ?>
<h1>Hello again</h1>
This is just another sample page. But it has some business logic done behind.
It retrives latest exchange rate. See <i>other.mod.php</i> for that.
<h2>Currency Exchange Rates on <?php
echo core::vars('rates')->date;
?>
</h2>
<h4>Comparing to <?php
echo core::vars('rates')->base;
?>
</h4>
<div style="-webkit-column-count:3; -moz-column-count:3; column-count:3;">
<? foreach (get_object_vars(core::vars('rates')->rates) as $symbol=>$rate): ?>
<div>
<?php
echo $symbol;
?>
-- <?php
echo $rate;
?>
</div>
<? endforeach ?>
</div>