本文整理汇总了PHP中Application::createUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::createUrl方法的具体用法?PHP Application::createUrl怎么用?PHP Application::createUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::createUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<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));
示例2: array
<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
}
?>
示例3: array
?>
</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)) {
?>
示例4: array
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
示例5: foreach
<?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>