Skip to content

Post-controller-constructor hook loses document data #1

Description

@apcomplete

Using a post_controller_constructor hook to set document data.

If a controller exists, but does not define desired method (in this case index), document library loses document data set by the hook.

Steps to reproduce:

  1. /about page defined in database with body and view set to default
  2. About controller implemented with no index method
  3. Post_controller_constructor hook function:
     if ( ! function_exists('get_foo'))
     {
        function get_foo()
        {
            $CI = get_instance();
            $CI->document->data('foo','bar');
        }
    }
  1. Visit /about, echo $this->document->foo, index not set on $CI->document->data on page load

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions