本文整理汇总了PHP中Ak::last方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::last方法的具体用法?PHP Ak::last怎么用?PHP Ak::last使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ak
的用法示例。
在下文中一共展示了Ak::last方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasCollisions
public function hasCollisions()
{
$this->collisions = array();
$this->namespace = AkInflector::underscore(Ak::first(explode(':', $this->task_name . ':')));
$this->task_name = AkInflector::underscore(Ak::last(explode(':', ':' . $this->task_name)));
$this->destination_path = AK_TASKS_DIR . DS . $this->namespace;
if (file_exists($this->destination_path . DS . $this->task_name . '.task.php')) {
$this->collisions[] = Ak::t('%path already exists', array('%path' => $this->destination_path . DS . $this->task_name . '.task.php'));
}
return count($this->collisions) > 0;
}
示例2: addFormatToParams
protected function addFormatToParams(&$params)
{
if (!AK_AUTOMATICALLY_ACCEPT_KNOW_FORMATS || empty($params) || isset($params['format'])) {
return;
}
$last_key = Ak::last(array_keys($params));
if (!is_string($params[$last_key])) {
return;
}
if ($format = strrchr($params[$last_key], '.')) {
$trimmed_format = trim($format, '.');
if (!AkMimeType::isFormatRegistered($trimmed_format)) {
return;
}
$params[$last_key] = substr($params[$last_key], 0, strpos($params[$last_key], $format));
$params['format'] = $trimmed_format;
}
}
示例3: test_decode_encoded_attachment_filename
function test_decode_encoded_attachment_filename()
{
$TestMailer =& new TestMailer();
$Mail =& $TestMailer->receive(file_get_contents(AK_TEST_DIR."/fixtures/data/action_mailer/raw_email8"));
$Attachment = Ak::last($Mail->attachments);
$this->assertEqual("01QuienTeDijat.Pitbull.mp3", $Attachment->original_filename);
}
示例4: test_decode_encoded_attachment_filename
public function test_decode_encoded_attachment_filename()
{
$TestMailer = new TestMailer();
$Mail = $TestMailer->receive(file_get_contents(AkConfig::getDir('fixtures') . DS . "raw_email8"));
$Attachment = Ak::last($Mail->attachments);
$this->assertEqual("01QuienTeDijat.Pitbull.mp3", $Attachment->original_filename);
}
示例5: _partialCounterName
protected function _partialCounterName($partial_name)
{
return Ak::last(explode('/', $partial_name)) . '_counter';
}
示例6: guessApplicationName
public function guessApplicationName()
{
$application_name = Ak::last(explode('/', AK_SITE_URL_SUFFIX));
$application_name = empty($application_name) ? substr(AK_BASE_DIR, strrpos(AK_BASE_DIR, DS) + 1) : $application_name;
return empty($application_name) ? 'my_app' : $application_name;
}
示例7: instantiateHelperAsHandlerAttribute
public function instantiateHelperAsHandlerAttribute($helper, $file)
{
$helper_class_name = AkInflector::camelize(strstr($helper, 'Helper') ? $helper : $helper . 'Helper');
if (!($file_path = $this->getHelperFileName($file))) {
return false;
}
include_once $file_path;
if (strstr($file_path, AK_ACTION_PACK_DIR . DS . 'helpers') && substr($helper_class_name, 0, 2) != 'Ak') {
$helper_class_name = 'Ak' . $helper_class_name;
$using_core_helper_alias = true;
}
if (class_exists($helper_class_name)) {
$attribute_name = Ak::last(explode(DS, substr($file_path, 0, -4)));
$this->_Handler->{$attribute_name} = new $helper_class_name($this->_Handler);
if (isset($using_core_helper_alias)) {
$attribute_name_alias = substr($attribute_name, 3);
if (!isset($this->_Handler->{$attribute_name_alias})) {
$this->_Handler->{$attribute_name_alias} = $this->_Handler->{$attribute_name};
}
}
if (method_exists($this->_Handler->{$attribute_name}, 'setController')) {
$this->_Handler->{$attribute_name}->setController($this->_Handler);
} elseif (method_exists($this->_Handler->{$attribute_name}, 'setMailer')) {
$this->_Handler->{$attribute_name}->setMailer($this->_Handler);
}
if (method_exists($this->_Handler->{$attribute_name}, 'init')) {
$this->_Handler->{$attribute_name}->init();
}
$this->_HelperInstances[$attribute_name] = $this->_Handler->{$attribute_name};
}
}
示例8: testMimetypeParserRecoginzesAdditionalParameters
public function testMimetypeParserRecoginzesAdditionalParameters()
{
$this->Request->env['HTTP_ACCEPT'] = 'text/html;q=0.9;key=value;throw_away';
$this->assertEqual(array('type' => 'text/html', 'q' => '0.9', 'key' => 'value', 'throw_away'), Ak::last($this->Request->getAcceptHeader()));
}