Bug Report #293
set_global(): take objects just like arrays
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Core | |||
| Target version: | 2.1 | |||
| Resolution: | wontfix | Points: |
Description
View_Core->set_global() takes variable_name - value pairs as well as associative arrays. I can't see a reason for it not to accept objects as well (and then just use the public member variables). It threw me when I was writing a bit of code and I'd like set_global() to just take my object without having to worry about casting it first.
Therefore: the world's shortest patch.
public function set_global( $name, $value = NULL )
{
if ( !is_array( $name ) && !is_object( $name ) ) {
// ...
History
Updated by Woody Gilk over 5 years ago
- Status changed from New to Closed
- Resolution set to wontfix
Casting is the correct way to solve this. If we start accepting objects for arrays, then it needs to be reflected across the entire framework. There is no reason to do that, at this time.