Welcome Guest, Not a member yet? Register   Sign In
Where do I put the jquery library and any plugins?
#1

[eluser]johnnyForums[/eluser]
Where is the correct place to put my jquery library and plugins so all views can see them?

Thank you.
#2

[eluser]Johan André[/eluser]
I usually create an assets-folder in the root containing images, js, css-folders.
#3

[eluser]johnnyForums[/eluser]
[quote author="Johan André" date="1249419490"]I usually create an assets-folder in the root containing images, js, css-folders.[/quote]

Sorry. Is the root just like it sounds, just after the main folder, outside of all the CI folders?
#4

[eluser]Johan André[/eluser]
the folderstructure should look like:

application (if you don't want it in the system-folder, which I don't)
assets
css
images
js
index.php
system
#5

[eluser]johnnyForums[/eluser]
[quote author="Johan André" date="1249422141"]the folderstructure should look like:

application (if you don't want it in the system-folder, which I don't)
assets
css
images
js
index.php
system[/quote]

Can you tell me why you move the application folder outside of system?
#6

[eluser]Johan André[/eluser]
Ofcourse...

I move the application folder to the root (and rename it to "app") because I develop most my projects with Subversion (using an external link to the CI-repository for grabbing the "system"-folder).
That way I keep my application completely isolated from the core-files (which IMHO never should be touched).

I like to keep the core system-files out of the way and focus on the app I'm writing.
Ofcourse, this does not affect the performance or functionality in anyway. It's just a matter of taste...
#7

[eluser]johnnyForums[/eluser]
[quote author="Johan André" date="1249427248"]Ofcourse...

I move the application folder to the root (and rename it to "app") because I develop most my projects with Subversion (using an external link to the CI-repository for grabbing the "system"-folder).
That way I keep my application completely isolated from the core-files (which IMHO never should be touched).

I like to keep the core system-files out of the way and focus on the app I'm writing.
Ofcourse, this does not affect the performance or functionality in anyway. It's just a matter of taste...[/quote]

Do you have to rewire everything if you do that? How does CI know where to find everything? BTW, thanks for all your answers.
#8

[eluser]Irimia[/eluser]
[quote author="johnnyForums" date="1249424240"]
Can you tell me why you move the application folder outside of system?[/quote]

You can find a good explanation here.
#9

[eluser]Johan André[/eluser]
You will have to change the $application_path in the index.php to your new path.

The assets is retrieved in views like:

Code:
<link rel="stylesheet" media="screen" href="<?=site_url('assets/css/style.css');?>" />

<img src="&lt;?=site_url('assets/images/image.jpg');?&gt;" alt="My image" />

Nice, right?
#10

[eluser]Irimia[/eluser]
[quote author="Johan André" date="1249436572"]
The assets is retrieved in views like:

Code:
&lt;link rel="stylesheet" media="screen" href="&lt;?=site_url('assets/css/style.css');?&gt;" /&gt;

<img src="&lt;?=site_url('assets/images/image.jpg');?&gt;" alt="My image" />

Nice, right?[/quote]

Or just add in your code
Code:
&lt;base href="&lt;?=base_url();?&gt;" /&gt;
then
Code:
<img src="/images/image.jpg" alt="My image" />




Theme © iAndrew 2016 - Forum software by © MyBB