本文整理匯總了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);
}