Welcome Guest, Not a member yet? Register   Sign In
admin and user side templates
#1

[eluser]mysterious[/eluser]
I am developing a small project that has user and admin sides. In my controllers folder there are two folders admin and user. Similarly in my views folder there are two folders admin and user. Both admin and user ends have different templates. I have placed CSS/Images/JS in assets folder that is placed in root folder (parallel to system folder). I do not want to make two different folders in assets folder for admin and user. Instead what i want is to place respective css/js/images in views/admin and views/user folders. This way i can remove assets folder and all html/css/images etc will be in same folder and i will be able to make different themes for user side. Is it possible?? If yes how?? Please guide me in detail.
#2

[eluser]brucebat[/eluser]
Would you not just have something like this?

Code:
-header file

if ($this->session->user_data['account_type'] == 'Admin')
echo 'Your css style for admin here';

else
echo 'Your css style for user here':

Also try the url helper for the assets folder in one place?
#3

[eluser]mysterious[/eluser]
I want to place css , images, js in views folder. Is it possible ??
#4

[eluser]pmoroom[/eluser]
[quote author="mysterious" date="1309651996"]I want to place css , images, js in views folder. Is it possible ??[/quote]

Not sure why but of course it would work. What issues are you having?

For example assuming a css folder and a test.css file.

<link rel='stylesheet' type='text/css' media='all' href='/application/views/css/test.css' />
#5

[eluser]mysterious[/eluser]
i was getting directory forbidden or something like this. I have removed index.php from URL using .htaccess. Is it causing a problem??
#6

[eluser]pmoroom[/eluser]
[quote author="mysterious" date="1309653881"]i was getting directory forbidden or something like this. I have removed index.php from URL using .htaccess. Is it causing a problem??[/quote]
Code:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
#7

[eluser]InsiteFX[/eluser]
The .htaccess file in the application folder is your problem!

Deny from all

InsiteFX
#8

[eluser]mysterious[/eluser]
[quote author="InsiteFX" date="1309683053"]The .htaccess file in the application folder is your problem!

Deny from all

InsiteFX[/quote]

How do i fix it ??
#9

[eluser]InsiteFX[/eluser]
You either need to remove it or modify it! It's there to stop people from getting in to the application folder.

InsiteFX
#10

[eluser]mysterious[/eluser]
[quote author="InsiteFX" date="1309849106"]You either need to remove it or modify it! It's there to stop people from getting in to the application folder.

InsiteFX[/quote]


i have modified it and now i can access views directory. but is my application still safe? What security issues can arise now? is it a good practice to place all assets in views? or should i find a way to move views folder out of application??




Theme © iAndrew 2016 - Forum software by © MyBB