普通的上一页，下一页方式

@return void
486531
private function f1()
    {
        $_linkstr = "\n<p class=\"links\">\n"; //begin
        if ($this->totalpage < 2) {
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">下一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">尾页</span> \n";
        } elseif ($this->cpage < 2) {
            // 首页
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a> \n";
        } elseif ($this->cpage >= $this->totalpage) {
            // ＝尾页
            $prepage = $this->cpage - 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<span class=\"disabled\">下一页</span>\n";
            $_linkstr .= "<span class=\"disabled\">尾页</span>" . "\n";
        } else {
            // 正常
            $prepage  = $this->cpage - 1;
            $nextpage = $this->cpage + 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a>\n";
        }
        $_linkstr .= "</p>\n"; //end div
        return $_linkstr;
    }
463708
public function handle()
    {

        if (! $this->preflighted()) return;

        while (true) {

            $contacts = $this->retrieve([
                'character_id' => $this->getCharacterId(),
            ]);

            if ($contacts->isCachedLoad()) return;

            collect($contacts)->each(function ($contact) {

                CharacterContact::firstOrNew([
                    'character_id' => $this->getCharacterId(),
                    'contact_id'   => $contact->contact_id,
                ])->fill([
                    'standing'     => $contact->standing,
                    'contact_type' => $contact->contact_type,
                    'is_watched'   => $contact->is_watched ?? false,
                    'is_blocked'   => $contact->is_blocked ?? false,
                    'label_ids'    => $contact->label_ids ?? null,
                ])->save();
            });

            $this->known_contact_ids->push(collect($contacts)
                ->pluck('contact_id')->flatten()->all());

            if (! $this->nextPage($contacts->pages))
                break;
        }

        // Cleanup old contacts
        CharacterContact::where('character_id', $this->getCharacterId())
            ->whereNotIn('contact_id', $this->known_contact_ids->flatten()->all())
            ->delete();
    }
385838
public function sort(): void {
        $r = new Stack();
        while (!$r->isEmpty()) {
            $tmp = $this->pop();

            while ((!$r->isEmpty()) && (Comparator::lessThan($r->peek(), $tmp))) {
                $this->push($r->pop());
            }
            $r->push($tmp);
        }
        while (!$r->isEmpty()) {
            $this->push($r->pop());
        }
    }
148274
public function load() {
		if ( true === $this->is_admin_loaded ) {
			return;
		}

		$this->loader->load();
		$this->is_admin_loaded = true;
	}
697341
public function touch()
    {
        $key = $this->getRelated()->getKeyName();

        $columns = $this->getRelatedFreshUpdate();

        $ids = $this->getRelatedIds();

        if (count($ids) > 0) {
            $this->getRelated()->newQuery()->whereIn($key, $ids)->update($columns);
        }
    }
1155832
public function load()
    {
        $contents = $this->client->get($this->key);

        if ($contents !== null) {
            $this->setFromStorage($contents);
        }
    }
1040327
public function handle()
    {

        $this->setConfig();

        $this->checkRequirements();

        if ( $this->InsertChartIntoFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

        $this->error('Oops, something went wrong!');


    }
95080
public function process()
    {
        for ($i = $this->io->inReadQueue(); $i > 0; $i--) {
            $this->handleMessage($this->io->pop());
        }
    }
1218013
public function handle() : void
    {
        if ($module = $this->option('module')) {
            $this->input->setOption('path', 'modules/' . $module . '/database/migrations');
        }

        parent::handle();
    }
449518
public function next()
    {
        $this->current = $this->parser->inner($this->start, $this->end);
        if ($this->current->isEmpty()) {
            $this->valid = false;
            $this->position = -1;
        } else {
            $this->valid = true;
            ++$this->position;
        }
    }
625139
public function up()
    {
        $this->addColumn(self::TABLE, 'property_id', $this->integer());
        $property = null;
        foreach(Lookup::find()->all() as $item) {
            if(!($property && $property->name == $item->type)) {
                if(!($property = Property::findOne(['name' => $item->type]))) {
                    $property = new Property([
                        'name' => $item->type,
                    ]);
                    $property->save();
                }
            }
            $item->property_id = $property->id;
            $item->save();
        }
        $this->createIndex('property_code', self::TABLE, ['property_id', 'code']);
        $this->addForeignKey ('FK_lookup_property', self::TABLE, 'property_id', '{{%property}}', 'id', 'CASCADE');
        $this->dropColumn(self::TABLE, 'type');
    }
532090
public function moveNext()
    {
        $this->peek = 0;
        $this->token = $this->next;
        $this->next = isset($this->tokens[++$this->i]) ? $this->tokens[$this->i] : null;

        return null !== $this->next;
    }
407015
public function handle(): void
    {
        // Update slug for specific category
        if ($this->category) {
            $this->setCategoryFullSlug($this->category);
            return;
        }

        // Regenerate full slug for all categories
        $categories = Category::root()->get();

        $categories->each(function (Category $category) {
            $this->setCategoryFullSlug($category);
        });
    }
882473
public function call()
    {
        $params = $this->app->router()->getCurrentRoute()->getParams();

        $options = $this->model->getOptionsList();
        if (isset($params['id'])) {
            $options = $this->model->getOptions();
        }

        if (in_array($this->app->request()->getMethod(), $options)) {
            $this->next->call();

            return;
        }

        $this->app->response()->setStatus(405); // Method Not Allowed
    }
845198
public function moveUp ()
		{
			if ($this->hasAttribute('order'))
			{
				$query = self::find()->where([ '>', 'order', $this->order ])->orderBy('order ASC');

				$condition = $this->orderCondition();
				if ($condition !== null)
				{
					$query->andWhere($condition);
				}

				$object = $query->one();
				if ($object != null)
				{
					$order = $object->order;
					$object->order = $this->order;
					$this->order = $order;
					$object->save();
					$this->save();
				}
			}
		}
1084771
public function join()
    {
        while (true) {
            $finished = true;
            foreach ($this->processes as $pid => $process) {
                if ($process->isAlive()) {
                    $finished = false;
                    break;
                }
            }

            if ($finished) {
                break;
            }

            unset($finished);
            usleep(10000);
        }
    }
544412
public function load()
    {
        $this->initialize();

        foreach ($this->dataSources as $name => $dataSource) {
            $dataSource->load();

            $this->processItems($dataSource->getItems(), $name);
            $this->processLayouts($dataSource->getLayouts(), $name);
            $this->processIncludes($dataSource->getIncludes(), $name);
        }
    }