Welcome Guest, Not a member yet? Register   Sign In
Absolute "noob" questions
#31

[eluser]Randy Casburn[/eluser]
[quote author="callumd" date="1225535658"]Also,

I'm assuming any 'images' or 'styles' folders should be hung off the application directory, yes?[/quote]

One of many possible solutions. Note that both application and system folders are outside the webserver DOCROOT...

Code:
/stuff
/ci_system
/ci_applications
  --/app1
     ---/config
     ---/controllers
     ---/models
       etc
  --/app2
     ---/config
     ---/controllers
     ---/models
       etc
/DOCROOT
  --/app1
    index.php
    .htaccess
     ---/scripts
     ---/images
     ---/css
  --/app2
    index.php
    .htaccess
     ---/scripts
     ---/images
     ---/css
#32

[eluser]Randy Casburn[/eluser]
[quote author="callumd" date="1225538752"]What is the correct way to access the base URL value in the config file?

Is it to use;

$this->config->item('base_url')

.. or to load the URL helper and use the base_url() function?[/quote]

Most of us use base_url(). Whether that is "the correct way" or not is subjective.

OK, you've been sufficiently spoon fed.

Now go make the best application known to man ;-P
#33

[eluser]Pascal Kriete[/eluser]
For the second template example, you don't need to echo them - CI will do that automatically. Also worth noting - any variables that you pass to the parent view will be available to the sub views automagically.
Code:
<html>
<head></head>
<body>
<? $this->load->view('header'); ?>
<div id='mySpecialPageStuff'>Hello World</div>
&lt;? $this->load->view('footer'); ?&gt;
&lt;/body&gt;
&lt;/html&gt;

[Edit: Whoa there Randy.]
#34

[eluser]Randy Casburn[/eluser]
Right...I also fixed the second 'header' in that post too...the cut n paster went a little wild n wooly on me.

Randy
#35

[eluser]callumd[/eluser]
Thanks for the answers, guys.

Randy -> I am assuming that the path to index.php is the "root" folder, yes?

If so, why does the default "installation" of CodeIgniter hang the system folder off the root directory?

As part of the CodeIgniter set up process, am I supposed to grab the application folder, and move it up one level in the tree structure?
#36

[eluser]Randy Casburn[/eluser]
[quote author="callumd" date="1225600483"]Randy -> I am assuming that the path to index.php is the "root" folder, yes?[/quote]

Bad assumption. You'll need an index.php file for each application folder you create. Or, in other words, for each application you create.

[quote author="callumd" date="1225600483"]If so, why does the default "installation" of CodeIgniter hang the system folder off the root directory?[/quote]

Because the CodeIgniter developers cannot read our minds. CI is very flexible in how it allows us to do our layouts. There are many, many ways to accomplish what I've shown you here. Many others do things differently. The CI developers cannot determine in advance which to choose, and at the same time have been gracious enough not to force us all into one solution.

[quote author="callumd" date="1225600483"]As part of the CodeIgniter set up process, am I supposed to grab the application folder, and move it up one level in the tree structure?[/quote]

No, as part of your development process you are supposed to decide if you want to provide a secure software installation in an environment full of miscreants, pirates, and nasties that may be interested in destroying your data, server, or stealing your information. If you do, then you should move both the CodeIgniter system directory and your application directories to a file system location that is outside your webserver's DOCROOT and not accessible by your webserver's user account.

I hope that answers your question.

Randy
#37

[eluser]callumd[/eluser]
Thanks, that does help.

Based on the tree structure you posted, I also notice you only have one instance of the system folder. I have been creating multiple instances of the entire CI folder structure for every application.

I'll use your tree structure as a starting point and see how I go.

Thanks for your responses.
#38

[eluser]callumd[/eluser]
Can I ask, where are the view files in your tree structure?
#39

[eluser]Pascal Kriete[/eluser]
In the application folder(s). You cannot easily move those subfolders as they form part of that specific application.
#40

[eluser]callumd[/eluser]
Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB