本文整理汇总了PHP中DateHelper::expiration_date_select方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::expiration_date_select方法的具体用法?PHP DateHelper::expiration_date_select怎么用?PHP DateHelper::expiration_date_select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::expiration_date_select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testExpiration_date_select
/**
* Test the expiration_date_select() method
*
* Test the {@link DateHelper::expiration_date_select()} method
*/
public function testExpiration_date_select()
{
$dh = new DateHelper('License', 'expiration_date');
$_REQUEST['License']['expiration_date(1i)'] = date('Y');
$_REQUEST['License']['expiration_date(2i)'] = '08';
// Test expiration date of August this year
$this->assertContains('<option value="' . date('Y') . '" selected="selected"', $dh->expiration_date_select());
$this->assertContains('<option value="' . (date('Y') + 7) . '"', $dh->expiration_date_select());
$this->assertContains('<option value="08" selected="selected">' . '8</option>', $dh->expiration_date_select());
}
示例2: expiration_date_select
/**
* Make a new DateHelper object and call its expiration_date_select() method
* @param string Name of an ActiveRecord subclass
* @param string Name of an attribute of $object
* @param mixed[] Format options
* @uses DateHelper::expiration_date_select()
*/
function expiration_date_select($object, $attribute, $options = array())
{
$date_helper = new DateHelper($object, $attribute);
return $date_helper->expiration_date_select($options);
}