本文整理汇总了PHP中ArrayList::append方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayList::append方法的具体用法?PHP ArrayList::append怎么用?PHP ArrayList::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayList
的用法示例。
在下文中一共展示了ArrayList::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __run
public static function __run(AppExecutionContext $context, MMapResponse $response)
{
$memoryManager = MemoryManager::getInstance();
Kernel::enterSystemMode();
$isExternLogin = $memoryManager->get('isExternLogin');
Kernel::exitSystemMode();
$list = new ArrayList();
$list->append($isExternLogin);
if ($isExternLogin) {
Kernel::enterSystemMode();
$username = $memoryManager->get('username');
$password = $memoryManager->get('password');
Kernel::exitSystemMode();
$list->append($username);
$list->append($password);
}
$context->setArgs($list);
$response->appendToBody('eyeos.isRegisterActive=' . self::isRegisterActive() . ';');
}
示例2: append
/**
* Appends the $value to the collection.
*
* @param mixed $value
* @param bool TRUE if the element has been appended successfully
*/
public function append($value)
{
if (!$this->contains($value, $this->strict)) {
parent::append($value);
return true;
}
return false;
}
示例3: __toString
echo "My name is {$this->name}\n";
}
public function __toString()
{
return $this->name;
}
}
// ArrayList::__construct()
$list = new ArrayList(NULL, 'Person');
$jack = new Person('Jack');
$mary = new Person('Mary');
$larry = new Person('Larry');
$foo = new ArrayObject();
// IList::append()
echo "Adding Jack\n";
$list->append($jack);
echo "Adding Mary\n";
$list->append($mary);
try {
echo "Adding foo\n";
$list->append($foo);
} catch (Exception $e) {
echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
// IList::offsetSet()
echo "Adding Jack using []\n";
$list[] = $jack;
try {
echo "Adding foo using []\n";
$list[] = $foo;
} catch (Exception $e) {