Welcome Guest, Not a member yet? Register   Sign In
[Solved] Default Controller To Work With Second Level
#1

[eluser]riwakawd[/eluser]
I would like to know if there is any one that came up with a MY_Router.php for new version of codeigniter that will allow the default controller route to have second level.

$route[default_controller] = "folder/folder/controller";

I am stuck on this. I may have to find another framework if it can't be done. But don't want to move from codeigniter. This is only downside not being able to have second level.

If any one comes across it please let me know. Been looking all over internet.
#2

[eluser]ivantcholakov[/eluser]
Why do you insist on this? What is the benefit?
#3

[eluser]riwakawd[/eluser]
[quote author="ivantcholakov" date="1398174816"]Why do you insist on this? What is the benefit?[/quote]

I have worked out to be able to get what I am after. I am have made second apps folder. Got it all working. Its not a issue any more.
#4

[eluser]InsiteFX[/eluser]
Could have just used HMVC and been done with it!
#5

[eluser]riwakawd[/eluser]
[quote author="InsiteFX" date="1398274968"]Could have just used HMVC and been done with it!
[/quote]

Not the hmvc I use would not pick up default extra folder in default route. This hmvc I use can call controllers with in ie. $this->load->controller.

I am over it now. I hope.

#6

[eluser]riwakawd[/eluser]
[quote author="InsiteFX" date="1398274968"]Could have just used HMVC and been done with it!
[/quote]

I tried it with the normal hmvc again still will not pick up

Code:
$route['default_controller'] = "catalog/common/home";

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends MX_Controller {

public function index() {
  $this->load->view('theme/default/common/template/home.tpl');
}
}
#7

[eluser]riwakawd[/eluser]
[quote author="ivantcholakov" date="1398174816"]Why do you insist on this? What is the benefit?[/quote]

Sorry for late reply.

I think having the extra folder capabilities for the $route[default_controller] is better.

It just makes it easier for making nice and cleaner files some people I have seen put all there admin files in one controller folder. You should be able to them to put in sub folders.

I know you can do it for custom routes but for some reason codeigniter does not allow it for $route[default_controller]

Because I like to separate them. example.

controller / frontend / common folder
controller / frontend / common / header.php
controller / frontend / common / footer.php
controller / frontend / common / home.php As default controller. Does not work because codeigniter don't allow extra folders. for $route[default_controller]

My own opinion they should let you be able to have unlimited folder range for default controller routes. But don't think they will change it.




Theme © iAndrew 2016 - Forum software by © MyBB