Welcome Guest, Not a member yet? Register   Sign In
Controllers in sub-folder
#1

[eluser]Nikhil Vijayan[/eluser]
I am now creating a website with member side and admin side using ci.

I created a folder called admin in the controllers folder.

Then created a controller named members inside the admin folder to view/edit/delete members.

The default index function is working when i access

Quote:http://site/admin/members

but when i call the member function view

Quote:http://site/admin/members/view

i am getting a 404 Page not Found error.

Anybody please help to solve this problem.


Quote:I Corrected it. The View function was renamed to View2 . This made it work properly
Is this view function a reserved or something... ???
#2

[eluser]xwero[/eluser]
Yes it is if you are using php4.

Reserved Function Names
#3

[eluser]Nikhil Vijayan[/eluser]
Another Problem

My css file is placed in the root as css/main.css

all the pages link to it using css/main.css

but the views in admin folder doesn't show css style ..

ANY idea ?

How can i correct it
#4

[eluser]NemetraL[/eluser]
As much as possible (meaning for all that kind of links), try the abolute paths using
Code:
<?php echo site_url(); ?>path/to/css/file
This way, it should work.
Remember to auto include the url helper first in the application/config/autoload.php file, otherwise you won't have access to
Code:
site_url();
#5

[eluser]Nikhil Vijayan[/eluser]
Thanks Nemetral. Your idea works.

I temporarily solved the problem by placing css file inside view folder and using

Code:
<style>
<? $this->load->view('main.css'); ?>
</style>

changing to site_url() method.
#6

[eluser]tinawina[/eluser]
Hi - not sure if this will help you (it did me). Check out this thread re: modular separation:

http://ellislab.com/forums/viewthread/46669/

The code you need is available through the CI wiki - search on modular separation.
#7

[eluser]esra[/eluser]
I use the same method suggested by NemetraL, but there is also a forum post about an assets_helper that allows you to define the paths to your css, image, and javascript files.




Theme © iAndrew 2016 - Forum software by © MyBB