本文整理汇总了PHP中Str::alternator方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::alternator方法的具体用法?PHP Str::alternator怎么用?PHP Str::alternator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::alternator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<div class="panelContent">
<?php
echo \Form::open(array('action' => \Uri::admin('current'), 'method' => 'get', 'class' => 'filter_form'));
$margin = \Str::alternator('m_r_15', 'm_r_15', 'm_r_15', '');
$status = array('false' => 'All', '1' => 'Active', '0' => 'Inactive');
?>
<div class="row-fluid blue_filters">
<table class="blue_filters_table">
<tr>
<td>
<div class="filter_width <?php
echo $margin();
?>
">
<div class="double_select">
<?php
echo \Form::label('Status');
?>
<?php
echo \Form::select('status', \Input::get('status'), array('select' => 'Select') + $status, array('class' => 'toggle_dates select_init filter_width', 'onchange' => "show_dates(\$(this), 2, \$('.toggable_dates'));"));
?>
</div>
<div class="toggable_dates date_content" <?php
echo \Input::get('status') != '2' ? 'style="display: none;"' : '';
?>
>
<?php
echo \Form::label('Dates Active', null, array('class' => 'dateLabel'));
示例2: test_alternator
/**
* Test for Str::alternator()
*
* @test
*/
public function test_alternator()
{
$alt = Str::alternator('one', 'two', 'three');
$output = $alt();
$expected = 'one';
$this->assertEquals($output, $expected);
$output = $alt(false);
$expected = 'two';
$this->assertEquals($output, $expected);
$output = $alt();
$expected = 'two';
$this->assertEquals($output, $expected);
$output = $alt();
$expected = 'three';
$this->assertEquals($output, $expected);
$output = $alt();
$expected = 'one';
$this->assertEquals($output, $expected);
}