ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Matchbox RC2

November 25, 2007 2:24pm

Subscribe [65]
  • #31 / Dec 01, 2007 11:18am

    gerben

    75 posts

    It happened in 0.9. I’m trying out 0.9.1 right now. Let you know if that fixes it.

    That’s wierd.. :S $this->view->load(’’) is basicly an alias for $this->load->view(), just with some added functionality before the call.

    If that is so, it’s really strange.

  • #32 / Dec 01, 2007 11:40am

    gerben

    75 posts

    I tested it in 0.9.1, but still get the same error:

    Unable to load the requested file: settings.php

    I use some custom routing, but that doesn’t seem to be the problem either.

  • #33 / Dec 01, 2007 11:43am

    zdknudsen

    305 posts

    I’ll download the view library and find out whats wrong.

  • #34 / Dec 01, 2007 12:51pm

    gerben

    75 posts

    Cool, thanks a lot!

  • #35 / Dec 01, 2007 1:12pm

    zdknudsen

    305 posts

    Ah, I found the problem 😊 When Matchbox tries to figure out what module is trying to load a resource it finds the file that called $this->load->RESOURCNAME. However, in this case its the view library that is the caller. I don’t suppose there’s an easy way to distinguish your own libraries with other peoples? I’ll have to think this throuh.

    However if you wish to find a quick fix, just put the View library in each module that requires it.

  • #36 / Dec 01, 2007 2:05pm

    zdknudsen

    305 posts

    Please tell me if that fixes your problem for now.

  • #37 / Dec 01, 2007 2:25pm

    gerben

    75 posts

    Sorry, I’m still figuring out how to load the view library.

    I’ve created a folder called libraries in my module folder, and put the view library in there. But how do I load it in the controller?

  • #38 / Dec 01, 2007 2:28pm

    zdknudsen

    305 posts

    You don’t have to do anything different. If you put your View library in the module folder it will load it from there instead, and since the view library is in the module folder it will also look for the view in the module folder. So putting the view library in the module folder should fix it. (i spelled “moduler folder” exactly 4 times XD )

  • #39 / Dec 01, 2007 2:35pm

    gerben

    75 posts

    I tried that, but just putting it in the module folder doesn’t work. I keep getting the “Unable to load the requested file: settings.php”

    Strange… What’s wrong with my app :S

  • #40 / Dec 01, 2007 2:37pm

    zdknudsen

    305 posts

    Hm. I’ll find a definate solution later tonight.

  • #41 / Dec 01, 2007 2:43pm

    gerben

    75 posts

    Thanx for all the effort you’re putting into this.

  • #42 / Dec 01, 2007 4:47pm

    esra

    485 posts

    Sorry, I’m still figuring out how to load the view library.

    I’ve created a folder called libraries in my module folder, and put the view library in there. But how do I load it in the controller?

    <?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
    
    require(APPPATH.'libraries/application'.EXT);
    
    class Frontpage extends Application {
    
        public function __construct()
        {
            parent::__construct();    
            $this->lang->load('frontpage', 'en_US');    
            $this->load->model('frontpage_model');
        }
        
        public function index()
        {
            $module = $this->lang->line('frontpage_module');
            $page = $this->lang->line('frontpage_title');
            
            $this->view->set('title', $page);
            $this->view->set('module', $module);
            $this->view->part('west', 'west');
            $this->view->part('north', 'north');
            $this->view->part('center2', 'center2');
            $this->view->part('center1', 'center1');
            $this->view->part('east', 'east');
            $this->view->part('south', 'south');
            $this->view->load('complex');
        }
    }
  • #43 / Dec 01, 2007 5:45pm

    zdknudsen

    305 posts

    Hm. It should work (just tried it myself) :S Basicly what happens is:

    You have the view library in the standard application folder. That means whenever you $this->view->load(), it will call the view library, that in turn will call the usual loader function. Now, when Matchbox tries to find out if it was a module that requested a view, it will think that the view library did so, and that view library is located in the application folder. Therefore it cannot find your view in the module folder. However, if you place your View libary in the module folder instead, Matchbox will know what module to look for the view in.

    Depending on how you wish to load it you can either $this->load->library(‘View’) in the controller, or if you wish to autoload the library you will have to insert $autoload[‘libraries’] = array(‘MODULENAME’ => ‘View’) instead of $autoload[‘libraries’] = array(‘View’);

    esra: Is that a working example, meaning that what he is trying to accomplish is doable?

  • #44 / Dec 01, 2007 6:38pm

    gerben

    75 posts

    Ok, if I put the view library in my module’s library folder, and in the controller I put:

    $this->load->library('View');

    I get the error:

    Cannot redeclare class View in
    xxxx/site/app/modules/api/libraries/View.php on line 11

  • #45 / Dec 01, 2007 6:48pm

    zdknudsen

    305 posts

    I think you might also be autoloading it. You can’t both autoload it and load it in the controller.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases