CodeIgniter Forums

Full Version: Moved Assets Folder Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]razerone[/eluser]
Hi.

I have moved my assets folder into application folder but now will not pick up my js or css file?
in my assets folder are sub-folders called

I have added url helper in auto load and my header controller

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

class Header extends CI_Controller {

function index() {

  $this->load-helper('url');

  $this->load->view('header');

}

}

<!-- header View -->

<meta charset="utf-8">
    <meta name="viewport" c initial-scale=1.0">
    <meta name="description" c>
    <meta name="keywords" c>
    <meta name="author" c>
    <link rel="shortcut icon" href="application/assets/ico/favicon.png">

    <title></title>

    <!-- Bootstrap core CSS -->
    <link href="<?=base_url()?>assets/css/bootstrap.css" rel="stylesheet">

    <!-- Bootstrap theme CSS -->
    <link href="<?php echo base_url();?>application/assets/css/bootstrap-theme.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      [removed][removed]
      [removed][removed]
    <![endif]--&gt;

El Forum

[eluser]Otemu[/eluser]
Hi,

Assets shouldn't go in the application folder, standard structure for CI is as follows:

application
system
assets
js
css
imgs

Good explanation here http://stackoverflow.com/questions/14403...odeigniter if you want to continue with having assets in your application folder

Thanks

El Forum

[eluser]razerone[/eluser]
I have made is like this

applications
index.php
assets
system

Is that OK or would you still recommend having in system.

El Forum

[eluser]CroNiX[/eluser]
You can't directly access anything that is in /system or /application via the url, on purpose. They are protected with an htaccess file. It's a security concern - otherwise people could directly load your controllers/models/libraries/views, etc.

Like you can't just go to www.yoursite.com/application/controllers/some_real_controller.

So the way you have it now is they way it should be - or in any other publicly accessible directory.

El Forum

[eluser]Otemu[/eluser]
[quote author="Carrara_WS" date="1382097661"]I have made is like this

applications
index.php
assets
system

Is that OK or would you still recommend having in system.[/quote]

Sorry that was an incorrect indentation from me, I have corrected Smile how you made it now is the standard structure

El Forum

[eluser]jairoh_[/eluser]
OT: what are assets for? sorry just learning

El Forum

[eluser]razerone[/eluser]
[quote author="jairoh_" date="1382153752"]OT: what are assets for? sorry just learning[/quote] assets is where I keep. my css and javascript and images its custom folder. Also new hmvc-codeigniter install wizard currently been made with my programmers. So you do not have to edit database config file you would go and through install stage and would dump you database details on there and would auto connect.

Also two other stages which are in the process.

Our website is currently been up graded http://www.carrarawebsitesolutions.com we use codeigniter and hmvc and bootstrap 3 template engines will be coming soon plus ci modules and hmvc modules.


you can view live updates of our progress at any time. It is on upgrade mode so some links may not work.