-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug: The system/View/Cell.php on return $instance->{$method}(); #8121
Comments
Thank you for reporting. It sounds like a bug, but Controlled Cell doesn't call the method. <?= view_cell('AlertMessageCell', 'type=warning, message=Failed.') ?> See https://codeigniter4.github.io/CodeIgniter4/outgoing/view_cells.html#creating-a-controlled-cell @lonnieezell What do you think? |
This is not a bug. It's just an OP's misconception of how Controlled Cells work. Simple Cells !== Controlled Cells. The user guide is very clear here. In Controlled Cells, parameters are always mapped to public variables of the class, which should be declared inside the class. |
How many dynamic vars are we going to have/declare inside the class?. |
You need to declare public properties of the class - as many as needed.
No, it's not a bug. This is how Controlled Cells were designed and work. If you need a described behavior just use Simple Cells: https://codeigniter4.github.io/CodeIgniter4/outgoing/view_cells.html#simple-cells |
Exactly that is the problem, I reported... |
The documentation seems to be a bit difficult to understand the difference between Simple and Controlled Cells. |
@MohammedNuru It seems you don't know the difference between Simple Cells and Control Cells. |
This is not a bug, but a misuse. |
PHP Version
8.1
CodeIgniter4 Version
4.4.3
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
macOS
Which server did you use?
apache
Database
MySQL
What happened?
File: system/View/Cell.php
the return method under or line 231.
return $instance->{$method}();
well this result in an error saying to few argument sent or not. but I have fixed it by writing it like.
return $instance->{$method}($params);
was this thing a bug or my mistake to correct it?
now seems working fine...
Steps to Reproduce
Download a fresh ci4 version 4.4.3,
create a cell (u can use the php spark make cell) like Cells/ClassCell
inside create method called ClassCell::MakeMethod(array $parma):string,
create a normal view file called normalView which is loaded from a controller as usual,
call the cell which load it's own from the view as
view_cell(ClassCell::MakeMethod, [whatever array or obj here])
this produce an error like too few argument or so...
Expected Output
I just wanted the CI4 to work without my correction... if that is bug, then good if not then correct me...
Anything else?
No response
The text was updated successfully, but these errors were encountered: