Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3

[eluser]wiredesignz[/eluser]
Well I see very little happening in your logs. The admin_model loads and it stops?

Example log:
Code:
DEBUG - 2008-07-17 17:06:20 --> Config Class Initialized
DEBUG - 2008-07-17 17:06:20 --> Hooks Class Initialized
DEBUG - 2008-07-17 17:06:20 --> URI Class Initialized
DEBUG - 2008-07-17 17:06:20 --> No URI present. Default controller set.
DEBUG - 2008-07-17 17:06:20 --> Router Class Initialized
DEBUG - 2008-07-17 17:06:20 --> Output Class Initialized
DEBUG - 2008-07-17 17:06:20 --> Input Class Initialized
DEBUG - 2008-07-17 17:06:20 --> Global POST and COOKIE data sanitized
DEBUG - 2008-07-17 17:06:20 --> Language Class Initialized
DEBUG - 2008-07-17 17:06:20 --> CMS Controller Initialized
DEBUG - 2008-07-17 17:06:20 --> Loader Class Initialized
DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: array, debug, flash, il8n
DEBUG - 2008-07-17 17:06:20 --> Database Driver Class Initialized
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/template/controllers/template.php
DEBUG - 2008-07-17 17:06:20 --> Template Controller Initialized
DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: url_helper
DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: form_helper
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/template/helpers/asset_helper.php
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/settings/controllers/settings.php
DEBUG - 2008-07-17 17:06:20 --> Settings Controller Initialized
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/settings/models/settings_model.php
DEBUG - 2008-07-17 17:06:20 --> Settings_model Model initialised
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/nav/controllers/nav.php
DEBUG - 2008-07-17 17:06:20 --> Nav Controller Initialized
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/nav/models/nav_model.php
DEBUG - 2008-07-17 17:06:20 --> Nav_model Model initialised
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/content/controllers/content.php
DEBUG - 2008-07-17 17:06:20 --> Content Controller Initialized
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/content/models/page_model.php
DEBUG - 2008-07-17 17:06:20 --> Page_model Model initialised
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/page_header.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/head_image.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/content.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/content.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/sidebar.htm
DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/default.htm
DEBUG - 2008-07-17 17:06:20 --> Final output sent to browser
DEBUG - 2008-07-17 17:06:20 --> Total execution time: 0.2936

[eluser]Stylec[/eluser]
Ok ive done a clean install of CI 1.6.3 + ME 4206. Moved the welcome controller and welcome view into a module. Created an admin module with just 1 controller (admin.php) and 1 method called 'test'. The admin method 'test' just echos a string.

In the welcome_message.php view file ive just got
Code:
echo modules::run('admin', '', 'test');
This works as expected and produces the following log
Code:
DEBUG - 2008-07-23 17:50:44 --> Config Class Initialized
DEBUG - 2008-07-23 17:50:44 --> Hooks Class Initialized
DEBUG - 2008-07-23 17:50:44 --> URI Class Initialized
DEBUG - 2008-07-23 17:50:44 --> No URI present. Default controller set.
DEBUG - 2008-07-23 17:50:44 --> Router Class Initialized
DEBUG - 2008-07-23 17:50:44 --> Output Class Initialized
DEBUG - 2008-07-23 17:50:44 --> Input Class Initialized
DEBUG - 2008-07-23 17:50:44 --> Global POST and COOKIE data sanitized
DEBUG - 2008-07-23 17:50:44 --> Language Class Initialized
DEBUG - 2008-07-23 17:50:44 --> Welcome Controller Initialized
DEBUG - 2008-07-23 17:50:44 --> Loader Class Initialized
DEBUG - 2008-07-23 17:50:44 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/admin/controllers/admin.php
DEBUG - 2008-07-23 17:50:44 --> Admin Controller Initialized
DEBUG - 2008-07-23 17:50:44 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/welcome/views/welcome_message.php
DEBUG - 2008-07-23 17:50:44 --> Final output sent to browser
DEBUG - 2008-07-23 17:50:44 --> Total execution time: 0.0949

But when I change it to
Code:
echo modules::run('admin/controllers/admin', '', 'test');
which I would have thought would have been the same thing as above, I just get a blank page and the following log.
Code:
DEBUG - 2008-07-23 17:52:11 --> Config Class Initialized
DEBUG - 2008-07-23 17:52:11 --> Hooks Class Initialized
DEBUG - 2008-07-23 17:52:11 --> URI Class Initialized
DEBUG - 2008-07-23 17:52:11 --> No URI present. Default controller set.
DEBUG - 2008-07-23 17:52:11 --> Router Class Initialized
DEBUG - 2008-07-23 17:52:11 --> Output Class Initialized
DEBUG - 2008-07-23 17:52:11 --> Input Class Initialized
DEBUG - 2008-07-23 17:52:11 --> Global POST and COOKIE data sanitized
DEBUG - 2008-07-23 17:52:11 --> Language Class Initialized
DEBUG - 2008-07-23 17:52:11 --> Welcome Controller Initialized
DEBUG - 2008-07-23 17:52:11 --> Loader Class Initialized
DEBUG - 2008-07-23 17:52:11 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/welcome/views/welcome_message.php
DEBUG - 2008-07-23 17:52:11 --> Final output sent to browser
DEBUG - 2008-07-23 17:52:11 --> Total execution time: 0.0826

Maybe its not possible to call a method from a controller which isn't named the same as the module folder?

[eluser]a&w[/eluser]
You might try:
Code:
echo modules::run('admin/admin', '', 'test');
I don't think you need to put controllers in there.

[eluser]Stylec[/eluser]
OK, that works in my clean install of CI + ME, and from that ive found that its because of the search paths as suggested by wiredesignz.
So how can I get around the problem of having an admin.php controller in each module?
I would have thought that as I specify the module the method is in, it wouldn't have been a problem.

[eluser]Chicken's Egg[/eluser]
I had some unexpected behaviour of ME today.

A have split the application folder into two separate folders: back-end en front-end. www.mysite.com/admin/ brings me to the back-end of the application. Normally the frond-end is used.

Situation:
- DIR: admin
- FILE: index.php
- DIR: frontend
- DIR: controllers
- FILE: base_controller.php
- (..)
- DIR: modules
- DIR: home
- DIR: controllers
- FILE: home.php- DIR: backend
- DIR: controllers
- FILE: base_controller.php
- (..)
- DIR: modules etc.
- DIR: home
- DIR: controllers
- FILE: home.php
- DIR: media
- FILE: index.php

My default controller is home.php

Situation now:
www.mysite.com/admin/ Shows backend home.php
www.mysite.com/admin/home/ Shows frontend home.php

The last is wrong and should have shown up the backend aswell. The base_controller is called like
include_once(APPPATH . 'controllers/base_controller.php') but doesn't have a function yet. I'm a little bit confused.

[eluser]wiredesignz[/eluser]
Why would you assume ME is doing this and not something else you have altered, or forgotten to alter correctly?

[eluser]Chicken's Egg[/eluser]
Well, I can't exclude that possibility, thought I wonder what it would have been.

Base_controller.php

Code:
<?php
class Base_controller extends Controller{

  protected $data = array();   // Array om data op te slaan.

  function __construct()
  {
    // Error reporting:
    ini_set('display_errors', 1);
    error_reporting(E_ALL);

    // Controller meeladen
    parent::Controller();
  }

  public function main_view()
  {
    // Template laden:
    $this->load->view($this->view_dir . 'main',$this->data);
  }
}
?>

home.php

Code:
<?php
// Base Controller activeren
include_once(APPPATH . 'controllers/base_controller.php');

class Home extends Base_controller {

    function __construct()
    {
      // Parent class meeladen
      // Uitvoeren:
      // - Hoofdmenu inbouwen
      // - Standaard teksten vastleggen.
      parent::__construct();
    }
    
    function index()
    {
      // Load view
      // parent::main_view();
      echo 'Backend test 1';
    }
}

I don't see any problem with these controllers. The controllers in the frontend look equal, but of course an other text is showed.

Alternations:
The follow is changed (according to the wiki) in order to get two applications:
1) Create a new directory called 'admin/'.
2) Copy the index.php file in 'admin/'
3) Copy the application folder and call it '
4) Open admin/index.php. Alter:
- Line 44: $application_folder = "../backend";

I wonder why I don't get the result I expect. There are no error-messages and I don't see anything special in the debug. I've also tested the possibility to place home.php into the default backend-controllers directory; same result. As for your question: no I don't know whether this is a CI or a ME problem. As www.mysite.com/admin/ worked fine I thought it might be a ME problem.

[eluser]wiredesignz[/eluser]
[quote author="Chicken’s Egg" date="1217325920"]I don't see any problem with these controllers.[/quote]

So where are the class variables for $this->view_dir and $this->data as shown above?

Why not remove the Modular Extensions libraries and see if your controllers load properly without it first.

[eluser]Chicken's Egg[/eluser]
I solved the problem by adding a .htaccess file in the admin-directory. I hope this will do the trick.

Quote:Why not remove the Modular Extensions libraries and see if your controllers load properly without it first.
I had done that, without any result.

[eluser]wiredesignz[/eluser]
[quote author="Chicken’s Egg" date="1217339468"]I had done that, without any result.[/quote]

So the problem was not with Modular Extensions.

Good luck with your application.




Theme © iAndrew 2016 - Forum software by © MyBB