Example #1
0
<div style="text-align: center"> <a href="<?php 
echo Application::createUrl(array('post' => 'index'));
?>
">Go to main page</a></div>
<?php 
$this->renderPartial('post/__form', array('post' => $post, 'tags' => $tags));
Example #2
0
<div class="post-form">
    <form method="post" action="<?php 
echo !empty($post->id) ? Application::createUrl(array('post' => 'update'), array('id' => $post->id)) : Application::createUrl(array('post' => 'add'));
?>
" enctype="multipart/form-data">
        <?php 
echo !empty($post->id) ? '<input name="Post[post_id]" type="hidden" value="' . $post->id . '"' : null;
?>
        <label for="title">Title:</label>

        <div class="post-title-block"><input value="<?php 
echo $post->title;
?>
" id="title" name="Post[title]" class="post-title" type="text"></div>
        <label for="image">Image:</label>

        <div class="post-file-block">
            <?php 
if (!empty($post->image)) {
    ?>
                <div><img src="<?php 
    echo Application::getParam('basePath');
    ?>
uploads/post/<?php 
    echo $post->image;
    ?>
" /></div>
                <br/>
            <?php 
}
?>
Example #3
0
?>
            </div>
        </div>
        <div class="post-tags-block">
            <div class="post-tags"><strong>Tags:</strong> <?php 
echo !empty($tags) ? Tag::tagImplode($tags) : null;
?>
</div>
        </div>
    </div>
</div>

<div class="comment-add-block">
    <h4>Add Comment</h4>
    <form method="post" action="<?php 
echo Application::createUrl(array('post' => 'comment'), array('id' => $post->id));
?>
">
        <input type="hidden" name="Comment[post_id]" value="<?php 
echo $post->id;
?>
" />
        <div class="comment-email"><input name="Comment[email]" type="text" placeholder="email"></div>
        <div class="comment-content"><textarea name="Comment[content]" placeholder="Comment text"></textarea></div>
        <div class="comment-submit"><input type="submit" value="Add comment"></div>
    </form>
</div>
<?php 
if (!empty($comments)) {
    ?>
Example #4
0
        echo $post->title;
        ?>
</a>
                    </div>
                    <div class="status">
                        status: <?php 
        echo $post->status_name;
        ?>
                    </div>
                    <div class="buttons">
                        <a class="btn" href="<?php 
        echo Application::createUrl(array('post' => 'edit'), array('id' => $post->id));
        ?>
">Edit</a>
                        <a class="btn" href="<?php 
        echo Application::createUrl(array('post' => 'delete'), array('id' => $post->id));
        ?>
">Delete</a>
                    </div>
                </div>
                <div class="content-block">

                    <div class="content">
                        <img src="<?php 
        echo Application::getParam('basePath');
        ?>
uploads/post/<?php 
        echo $post->image;
        ?>
"/>
                        <?php 
Example #5
0
<?php

/**
 * @var $post Post
 */
?>
<h1>Blog</h1>

<div class="post-block">
    <div class="post-add">
        <a class="post-add-btn" href="<?php 
echo Application::createUrl(array('post' => 'add'));
?>
">New Post</a>
    </div>
    <?php 
if (!isset($posts) && empty($posts)) {
    ?>
        <p>Records is not exist</p>;
    <?php 
} else {
    ?>
        <?php 
    foreach ($posts as $post) {
        ?>
    <div class="post">
        <div class="title-block">
            <div class="title"><?php 
        echo $post->title;
        ?>
</div>