当前位置: 首页>>代码示例>>PHP>>正文


PHP Blog::getPost方法代码示例

本文整理汇总了PHP中Blog::getPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::getPost方法的具体用法?PHP Blog::getPost怎么用?PHP Blog::getPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blog的用法示例。


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

示例1:

<?php

Chunk::get('header');
?>
<div class="container-wide"><div class="container"><div class="row">
<div class="col-xs-12">
<?php 
Action::run('theme_pre_content');
?>
</div>
</div><div class="row">
<div class="col-xs-12">
<div class="monstra-blog-post">
<?php 
echo Blog::getPost();
?>
</div>
<small class="monstra-blog-date"><?php 
echo Blog::getPostDate('d M Y');
?>
 / <?php 
echo Blog::getPostAuthor();
?>
</small>
</div>
</div><div class="row">
<div class="col-xs-12">
<?php 
Action::run('theme_post_content');
?>
</div>
开发者ID:jessicaGithub,项目名称:portfolio2016,代码行数:31,代码来源:theme.default.minify.blog-post.template.php

示例2:

}
?>
			<div class="jumbotron">
				<h1>Hello!</h1>
				<?php 
if (!$user->isLoggedIn()) {
    echo '<h3>Please come and stay for an while</h3>';
} else {
    echo 'Welcome back ' . $user->data()->name;
}
?>
			</div>
			<div class="col-md-9">
				<?php 
$i = 0;
foreach ($blog->getPost() as $cat) {
    if ($i <= 4) {
        echo '<div class="panel panel-primary">';
        echo '<div class="panel-heading">';
        echo '<h3 class="panel-title">' . $cat->title . ' ~ ' . $cat->name . ' @ ' . $cat->date . ' By: ' . $cat->author . '</h3>';
        echo '</div>';
        echo '<div class="panel-body">';
        echo $cat->content;
        echo '</div>';
        echo '</div>';
    }
    $i++;
}
?>
			</div>
			<div class="col-md-3">
开发者ID:Root3287,项目名称:PHP-Blog,代码行数:31,代码来源:index.php

示例3: foreach

    if (!$val->passed()) {
        ?>
<div class="alert alert-danger"><?php 
        foreach ($val->errors() as $error) {
            echo $error . '<br/>';
        }
        ?>
</div><?php 
    }
}
?>
				<form action="" method="post">
					<div class="form-group">
					<select name="post_id">
						<?php 
foreach ($blog->getPost() as $post) {
    echo "<option name='cat' id='cat' value='{$post->post_id}'>{$post->title}</option>";
}
?>
					</select>
					</div>
					<div class="form-group">
						<label for="Confirm">Ready for deletion</label>
						<input type="checkbox" id="Confirm" name="ConfirmDel" value="hello">
					</div>
					<div class="form-group">
						<input type="hidden" name="token" value="<?php 
echo Token::generate();
?>
">
						<button type="submit" class="btn btn-primary">Delete</button>
开发者ID:Root3287,项目名称:PHP-Blog,代码行数:31,代码来源:deletePost.php

示例4:

<body>
  <div id="wrapper">
    <header>
      <a href="http://zx.rs/" class="logo">
        Z
        <span class="blue sub">X</span>
        <span class="desc-top"><span class="blue">c</span>oder<span class="blue">'</span>s</span>
        <span class="desc-bot"><span class="blue">b</span>log</span>
      </a>    
    </header>

    <section id="content">
      <?php 
if (!$_REQUEST['err']) {
    if ($_REQUEST['id']) {
        echo $blog->getPost($_REQUEST['id'], $_SESSION['username']);
    } else {
        echo $blog->printPosts();
    }
} else {
    echo $blog->displayMsg($_REQUEST['err']);
}
?>
    </section>

    <section id="sidebar">
      <h3>latest <span class="blue">posts</span></h3>
      <ul id="posts">
        <?php 
echo $blog->printBlogPosts();
?>
开发者ID:anbud,项目名称:zx,代码行数:31,代码来源:index.php

示例5: foreach

?>
<html>
	<head>
		<?php 
include path . 'assets/php/css.php';
?>
	</head>
	<body>
		<?php 
include path . 'assets/php/nav.php';
?>
		<div class="container">
			<div class="col-md-9">
				<?php 
if (!Input::exists('get')) {
    foreach ($blog->getPost() as $cat) {
        echo '<div class="panel panel-primary">';
        echo '<div class="panel-heading">';
        echo '<h3 class="panel-title">' . $cat->title . ' ~ ' . $cat->name . ' @ ' . $cat->date . ' By: ' . $cat->author . '</h3>';
        echo '</div>';
        echo '<div class="panel-body">';
        echo $cat->content;
        echo '</div>';
        echo '</div>';
    }
} else {
    if (Input::get('c') != null) {
        $c = Input::get('c');
    } else {
        $c = null;
    }
开发者ID:Root3287,项目名称:PHP-Blog,代码行数:31,代码来源:index.php


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