Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In OffsetPagination, no way of setting private member variables $labelPrevious, $labelNext, $labelFirst, $labelLast #177

Closed
aphraoh opened this issue Mar 30, 2024 · 3 comments
Labels
status:ready for adoption Feel free to implement this issue.

Comments

@aphraoh
Copy link
Contributor

aphraoh commented Mar 30, 2024

What steps will reproduce the problem?

In OffsetPagination no way of setting private member variables below...
private string|Stringable|null $labelPrevious = '⟨';
private string|Stringable|null $labelNext = '⟩';
private string|Stringable|null $labelFirst = '⟪';
private string|Stringable|null $labelLast = '⟫';

What is the expected result?

Would expect public member functions below...
public function labelPrevious(string|Stringable|null $labelPrevious): self {$new=clone $this;$new->labelPrevious=$labelPrevious;return $new;}
public function labelNext (string|Stringable|null $labelNext): self {$new=clone $this;$new->labelNext=$labelNext; return $new;}
public function labelFirst (string|Stringable|null $labelFirst): self {$new=clone $this;$new->labelFirst=$labelFirst; return $new;}
public function labelLast (string|Stringable|null $labelLast): self {$new=clone $this;$new->labelLast=$labelLast; return $new;}

You can then do something like this...
$pagination = (new OffsetPagination())
->paginator($paginator)
->labelPrevious(NoEncode::string('<i class="fas fa-play fa-rotate-180"></i>'))
->labelNext(NoEncode::string('<i class="fas fa-play"></i>'))
->labelFirst(null)
->labelLast(null);

What do you get instead?

Instead you are stuck with the default setting.

Additional info

@vjik if you find this code change exceptable, I can do change and submit pull request.

Q A
Version master
PHP version 8
Operating system Window/Linux
@vjik vjik added the status:ready for adoption Feel free to implement this issue. label Mar 30, 2024
@vjik
Copy link
Member

vjik commented Mar 30, 2024

@aphraoh Yes, this good suggestion.

aphraoh added a commit to aphraoh/yii-dataview that referenced this issue Mar 30, 2024
In OffsetPagination, no way of setting private member variables $labelPrevious, $labelNext, $labelFirst, $labelLast (Issue yiisoft#177)
@aphraoh
Copy link
Contributor Author

aphraoh commented Mar 30, 2024

@vjik , done, please see pull request #178

@vjik
Copy link
Member

vjik commented Mar 31, 2024

Done by #178

@vjik vjik closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

No branches or pull requests

2 participants