本文整理汇总了PHP中Poll::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Poll::all方法的具体用法?PHP Poll::all怎么用?PHP Poll::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poll
的用法示例。
在下文中一共展示了Poll::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printf
$message = "La encuesta ha sido %s. <a href=\"%s\">Verla</a>";
?>
<div class="alert alert-success"><?php
printf($message, Param::get('updated') == 'true' ? 'actualizada' : 'creada', Url::get('vote', $id));
?>
</div>
<?php
}
unset($id);
unset($message);
?>
<section class="span5 pull-left">
<h2>Selecciona una encuesta</h2>
<ul>
<?php
foreach (Poll::all() as $poll) {
?>
<li class="poll poll-<?php
echo $poll->id;
?>
">
<a href="<?php
echo Url::get('admin@edit', $poll->id);
?>
" title="<?php
echo $poll->question;
?>
"><?php
echo $poll->question;
?>
</a></li>
示例2: action_index
public static function action_index()
{
return View::make('home.index')->add_var('polls', Poll::all());
}
示例3:
<div class="row">
<div id="first" class="col-sm-4">
<h3>About iRate Politics</h3>
<p>iRate Politics will change politics as we know it by restoring the democracy, and put the power back into the hands of the people. It is the first website to give Americans a fun, yet influential, and addicting, yet satisfying, way to be active in their government and really make a difference.
<a href="/about/">More »</a></p>
</div><!-- #first .footer-col -->
<div id="second" class="col-sm-4">
<h3>Latest Polls</h3>
<ul><?php
$polls = Poll::all()->take(3);
?>
@foreach($polls as $poll)
<?php
$question = $poll->questions->first();
?>
<li><a href="{{URL::route('question',$question->id)}}">{{$question->content}}</a></li>
@endforeach
</ul>
</div><!-- #second .footer-col -->
<div id="third" class="col-sm-4">
<h3>Quick Links</h3>
<div class="row">