TP Framework Pagination Class I saw it from the beginning. A private property is defined $url = ';
I think there are two places here that use this private property.
This private method runs to this private method on the top of this show method $url This property is empty, does it not error?
private function url($page){ return str_replace(urlencode('[PAGE]'), $page, $this->url); }public function show() { if(0 == $this->totalRows) return ''; $this->parameter[$this->p] = '[PAGE]'; $this->url = U(ACTION_NAME, $this->parameter);……
Reply content:
TP Framework Pagination Class I saw it from the beginning. A private property is defined $url = ';
I think there are two places here that use this private property.
This private method runs to this private method on the top of this show method $url This property is empty, does it not error?
private function url($page){ return str_replace(urlencode('[PAGE]'), $page, $this->url); }public function show() { if(0 == $this->totalRows) return ''; $this->parameter[$this->p] = '[PAGE]'; $this->url = U(ACTION_NAME, $this->parameter);……
Are you sure you understand programming?
All functions exist to define and invoke two procedures, and you see two defined processes.
The use of variables in the definition process does not really use variables, and variables are used in the process of invocation.
So the order of the definition does not affect the value of the variable, but also the above and below points.
The description of the Str_replace function has a sentence: the function is binary safe.
Binary security, as I understand it, can handle any byte input correctly, even if it contains 0 value bytes. The concept of binary security can also be searched by the owner.
Is your URL a private property or a private method?
$this->url This private property is defined in your Show method and will not be empty.
What's the answer? Dizzy, is it a programmer?
First he is a class, you call is not a static function, so the URL is created when the class instance is initialized, he is ", empty string, not undefined, is defined but is empty. So there will be no error.