Welcome Guest, Not a member yet? Register   Sign In
Matchbox RC2

[eluser]lancemonotone[/eluser]
[quote author="Zacharias Knudsen" date="1196909100"]The Scaffolding of CI is very limited (it doesn't even work with controllers in subdirectories). I'm not sure if it works with Matchbox, and I know of people who've had problems with it as well so its not just you Wink

However, if it is possible you are definately going to need to have a controller with the same name as the module, you can then access it by yoursite.com/module/method (no need for controllername). Try it out, I'm afraid it won't work though.

I might extend the Scaffolding class in the next release in order to let it work with modules Smile[/quote]

To enable scaffolding with Matchbox replace:

application\libraries\Loader.php, Line 835:

Code:
$module = $this->_matchbox->argument(1);

if (!$_ci_path = $this->_matchbox->find($_ci_path, $module, $search)) {
     show_error('Unable to load the requested file: ' . $_ci_file);
}

with:

Code:
if(!stripos($_ci_path, 'scaffolding')){
     $module = $this->_matchbox->argument(1);

     if (!$_ci_path = $this->_matchbox->find($_ci_path, $module, $search)) {
          show_error('Unable to load the requested file: ' . $_ci_file);
     }
}
else
{
     if ( ! file_exists($_ci_path))
     {
          show_error('Unable to load the requested file: '.$_ci_file);
     }
}

[eluser]frenzal[/eluser]
I was looking in to matchbox for a cms, it seemed a good way to keep things structured. However the problem is I'd need 2 controllers per module (one front end, one backend) but this doesn't seem possible preforbly I'd be able to use a subfolder in controllers too so i can have /admin/controller. Could playing around with the matchbox router.php get this working or am I likely to run in to trouble?

[eluser]adamp1[/eluser]
That does currently work with Matchbox, I know becasue I'm using it right now. What you are forgetting is this.

Say you have a module as so:
Code:
myapp
  |- myapp.php
  |- admin
     |- backend.php

So to call the myapp.php all you need is index.php/myapp. To call the other controller you would do index.php/myapp/admin/backend. What is different is you have an extra segment which contains the module name. If no controller is given then it trys to fetch the default controller (the one called the same as the module).

Hope this helps

[eluser]frenzal[/eluser]
Glad it works, i'll try it out later. cheers!

[eluser]frenzal[/eluser]
edit: spoke to soon i think - got some more testing to do ^^

[eluser]miguelp[/eluser]
hey, is there anyway, to specify a controller by default?
i have a module, loaded by default, like "site" but i what the controller to have another name, like "artesanato", so i can end up with:
http://mydomain.com/index.php/site/artesanato/

instead of:
http://mydomain.com/index.php/site/site/

is there anyway to configure the default controller name for a specific module?

[eluser]adamp1[/eluser]
If the controller is called the same as the module it is called by default.

So why not call your module artesanato and the controller artesanato, then you can use http://mydomain.com/index.php/artesanato

[eluser]zdknudsen[/eluser]
Also, Matchbox overwrites the (lacking) default controller mechanism, so you can supply an actual uri. That means you should be able to set the default controller to "site/atesanato".

frenzal: Please let me know if you have any problems with the subfolder system.

[eluser]Tony Nash[/eluser]
I am working on a new project. The site needs shopping cart and CMS features. I think I will do modular type development here. But I am not sure whether I should use HMVC or Matchbox. Both seem very good. Hope someone could help me to find answers to bellow.

A) If I use any of modular (HMCV, Matchbox) type with my application, do I not need to use "controller" folder in application?

B) I would like to call functions (controllers, modules, libraries and helper) from other module to other. Is that possible with HMCV or Matchbox?

[eluser]zdknudsen[/eluser]
A) You'll have to keep the "application/controllers" folder no matter what library you use. However, in Matchbox you won't have to place anything in there. ME on the other hand, will require you to have at least one controller for routing purposes in there.

B) Both are capable of calling resources from other modules with one major difference. Only ME can call controllers from other modules. Apart from that, it's the same.

Now, on the matter of which to choose, I think it boils down to personal preference. Basicly this is how the two differ
Matchbox
No need to alter codingstyle
Extends CodeIgniter core
Includes routing functionality (e.g. URI /modulename/controller will lead to correct module)
You can split an existing application into modules and still have it work

Modular Extensions
Requires some adjustments in the way you code
An additonal library, no extending of core
No built-in routing (you have to route yourself)
Can be used as HMVC controllers




Theme © iAndrew 2016 - Forum software by © MyBB