classes/Controllers/Base.php
private function init()
    {
        // Set the layout from the Config file
        $this->layout = View::make(config('decoy.core.layout'));

        // Store the controller class for routing
        $this->controller = get_class($this);

        // Get the controller name
        $controller_name = $this->controllerName($this->controller);

        // Make a default title based on the controller name
        if (empty($this->title)) {
            $this->title = $this->title($controller_name);
        }

        // Figure out what the show view should be.  This is the path to the show
        // view file.  Such as 'admin.news.edit'
        if (empty($this->show_view)) {
            $this->show_view = $this->detailPath($this->controller);
        }

        // Try to suss out the model by singularizing the controller
        if (empty($this->model)) {
            $this->model = $this->model($this->controller);
            if (!class_exists($this->model)) {
                $this->model = null;
            }
        }

        // If the input contains info on the parent, immediately instantiate
        // the parent instance.  These are populated by some AJAX calls like
        // autocomplete on a many to many and the attach method.
        if (($parent_id = request('parent_id'))
            && ($parent_controller = request('parent_controller'))) {
            $parent_model_class = $this->model($parent_controller);
            $this->parent($parent_model_class::findOrFail($parent_id));
        }
    }
private function init()
    {
        // Set the layout from the Config file
        $this->layout = View::make(config('decoy.core.layout'));

        // Store the controller class for routing
        $this->controller = get_class($this);

        // Get the controller name
        $controller_name = $this->controllerName($this->controller);

        // Make a default title based on the controller name
        if (empty($this->title)) {
            $this->title = $this->title($controller_name);
        }

        // Figure out what the show view should be.  This is the path to the show
        // view file.  Such as 'admin.news.edit'
        if (empty($this->show_view)) {
            $this->show_view = $this->detailPath($this->controller);
        }

        // Try to suss out the model by singularizing the controller
        if (empty($this->model)) {
            $this->model = $this->model($this->controller);
            if (!class_exists($this->model)) {
                $this->model = null;
            }
        }

        // If the input contains info on the parent, immediately instantiate
        // the parent instance.  These are populated by some AJAX calls like
        // autocomplete on a many to many and the attach method.
        if (($parent_id = request('parent_id'))
            && ($parent_controller = request('parent_controller'))) {
            $parent_model_class = $this->model($parent_controller);
            $this->parent($parent_model_class::findOrFail($parent_id));
        }
    }
private function init ( ) { // Set the layout from the Config file $ this -> layout = View :: make ( config ( 'decoy.core.layout' ) ) ; // Store the controller class for routing $ this -> controller = get_class ( $ this ) ; // Get the controller name $ controller_name = $ this -> controllerName ( $ this -> controller ) ; // Make a default title based on the controller name if ( empty ( $ this -> title ) ) { $ this -> title = $ this -> title ( $ controller_name ) ; } // Figure out what the show view should be.  This is the path to the show // view file.  Such as 'admin.news.edit' if ( empty ( $ this -> show_view ) ) { $ this -> show_view = $ this -> detailPath ( $ this -> controller ) ; } // Try to suss out the model by singularizing the controller if ( empty ( $ this -> model ) ) { $ this -> model = $ this -> model ( $ this -> controller ) ; if ( ! class_exists ( $ this -> model ) ) { $ this -> model = null ; } } // If the input contains info on the parent, immediately instantiate // the parent instance.  These are populated by some AJAX calls like // autocomplete on a many to many and the attach method. if ( ( $ parent_id = request ( 'parent_id' ) ) && ( $ parent_controller = request ( 'parent_controller' ) ) ) { $ parent_model_class = $ this -> model ( $ parent_controller ) ; $ this -> parent ( $ parent_model_class :: findOrFail ( $ parent_id ) ) ; } }
Populate the controller's protected properties

@return void
Populate the controller s protected properties