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

Added get_header method to Output class. #645

Closed
wants to merge 5 commits into from
Closed

Added get_header method to Output class. #645

wants to merge 5 commits into from

Conversation

garthkerr
Copy link
Contributor

No description provided.

@garthkerr
Copy link
Contributor Author

I have a hook that overrides the final output. The hook needs to check if the Content-Type header has been sent. There was no way to access header information that had already been sent via:

$this->output->set_header();

The method will send back headers set by the Output class, or using the traditional header() function.

@timw4mail
Copy link
Contributor

Seems like an excellent addition to me.

@mpmont
Copy link
Contributor

mpmont commented Nov 8, 2011

Loved it! even yesterday I was making a rss feed and this would be of great help to me :P

@garthkerr
Copy link
Contributor Author

Any traction on this? or should it be closed?

@petsagouris
Copy link
Contributor

@garthkerr this misses a changelog entry and user guide documentation.

@garthkerr
Copy link
Contributor Author

@petsagouris I have added the documentation and changelog.

@petsagouris
Copy link
Contributor

@garthkerr thanks, a repo collaborator should review this now ;) //cc @narfbg

* For an individual header, the value is returned. For an array
* of headers, a key-value array is returned.
*
* @access public
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

@garthkerr
Copy link
Contributor Author

Bump?

$value = trim($header_array[1]);

// Add new or replace existing when specified
if ( ! isset($headers[$field]) || $output_header[1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| must be changed to OR, as per the style guide.

@narfbg
Copy link
Contributor

narfbg commented Jun 15, 2012

You'll also need to sync with the repo as it's currently in conflict.

Poke me after you're done as commits don't issue notifications, so I didn't see the previous one as well.

narfbg added a commit that referenced this pull request Nov 29, 2012
(an improved version of PR #645)

Also fixed get_content_type() to only return the MIME value and created
Output library unit tests for both of these methods.
@narfbg
Copy link
Contributor

narfbg commented Nov 29, 2012

See the above commit.

@narfbg narfbg closed this Nov 29, 2012
nonchip pushed a commit to nonchip/CodeIgniter that referenced this pull request Jun 29, 2013
(an improved version of PR bcit-ci#645)

Also fixed get_content_type() to only return the MIME value and created
Output library unit tests for both of these methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants