EllisLab text mark
Advanced Search
     
Controllers in sub-folder
Posted: 30 August 2007 08:11 AM   [ Ignore ]
Avatar
Joined: 2007-06-06
28 posts

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

http://site/admin/members

but when i call the member function view

http://site/admin/members/view

i am getting a 404 Page not Found error.

Anybody please help to solve this problem.

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

 
Posted: 30 August 2007 08:53 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-07-14
4237 posts

Yes it is if you are using php4.

Reserved Function Names

 
Posted: 31 August 2007 05:49 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-06
28 posts

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

 
Posted: 31 August 2007 11:59 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-01-12
37 posts

As much as possible (meaning for all that kind of links), try the abolute paths using

<?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

site_url(); 
 Signature 

http://nemetral.com
http://nemetral.net

 
Posted: 01 September 2007 02:17 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-06
28 posts

Thanks Nemetral. Your idea works.

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

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

changing to site_url() method.

 
Posted: 01 September 2007 06:32 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2007-04-12
101 posts

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.

 
Posted: 01 September 2007 04:20 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2006-07-10
485 posts

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.