Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
No Valid Template Could be Found
  • My Backend Controller is below

    public function before(){
           
            // load the theme template
            $this->theme = \Theme::forge(array(
                                'active' => 'default',
                                'fallback' => 'default',
                                'view_ext' => '.php',
                                'paths' => array(
                                                DOCROOT.'themes'.DS.'backend',
                                            ),
                                'assets_folder' => 'themes/backend',
                            ));

            // set the page template
            $this->theme->set_template('index');
        }

    the file is there, theme detected. getting this error
    "No valid template could be found. Use set_template() to define a page template."

    when i debug::dump($this->theme);

    i getting template variable filled with this.
    protected global_data (Array, 0 elements)
            protected global_filter (Array, 0 elements)
            protected request_paths (Array, 0 elements)
            protected auto_filter (Boolean): true
            protected local_filter (Array, 0 elements)
            protected file_name (String): "D:\xampp\htdocs\fuel.dev\public\themes\backend\default\.\index.php" (66 characters)
            protected data (Array, 0 elements)
            protected extension (String): "php" (3 characters)
            protected active_request (Object #15): Fuel\Core\Request

    check the "file_name"

    why it showing in this way?
            protected file_name (String): "D:\xampp\htdocs\fuel.dev\public\themes\backend\default\.\index.php" (66 characters)
    why \.\ is coming in file_name?  i think it is the issue
  • You get that error if there is no template set at all.

    Looking at your dump, I'd say you're overwriting your own variables, a Theme instance doesn't have a property called "global_data". This looks like a View object.
  • this is the template i have set

    D:\xampp\htdocs\fuel.dev\public\themes\backend\default\.\index.php

    the same working when i changing theme dir to APPPATH.
    In forge method, i getting same issue

  • I can't comment with this information. The data you dumped in your previous post shows that $this->theme does not contain a Theme object.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion