Permalink
Browse files

Rounded out docs, fixed inconsistencies

  • Loading branch information...
1 parent 15cc819 commit a6a9eb5d937731a00c3453e95a9ecaf554f94bd7 @katzgrau committed May 7, 2011
Showing with 38 additions and 20 deletions.
  1. +28 −9 application/views/home/get_sparks.php
  2. +10 −11 application/views/home/make_sparks.php
@@ -19,13 +19,13 @@
</p>
<code>
- <?php echo config_item('install_prototype_nix'); ?> example-spark
+ <?php echo config_item('install_prototype_nix'); ?> -v1.0.0 example-spark
</code>
On Windows, type:
<code>
- <?php echo config_item('install_prototype_win'); ?> example-spark
+ <?php echo config_item('install_prototype_win'); ?> -v1.0.0 example-spark
</code>
You should see:
@@ -37,14 +37,25 @@
[ SPARK ] Spark installed to ./sparks/example-spark/1.0.0 - You're on fire!
</pre>
-Now your spark is installed! In your application, try:
+<p>Specifying the version isn't required. You can leave that -v1.0.0 option out
+in order to get the latest version.</p>
+
+<p>Anyway, now your spark is installed! In your application, try:</p>
<pre>
-$this->load->spark('example-spark/1.0.0'); # We always specify the version for now. This might change
+$this->load->spark('example-spark/1.0.0'); # We always specify the full path from the spark folder
$this->example_spark->printHello(); # echo's "Hello from the example spark!"
</pre>
-<p>Now you can install all the sparks you want. And if you feel like contributing your own, check out <a href="<?php echo base_url(); ?>make-sparks">Making Sparks</a>.</p>
+<p>
+ Now you can install all the sparks you want! You can even autoload sparks
+ in your application's config/autoload.php:
+</p>
+<pre>
+$autoload['sparks'] = array('example-spark/1.0.0');
+</pre>
+
+<p>If you feel like contributing your own, check out <a href="<?php echo base_url(); ?>make-sparks">Making Sparks</a>.</p>
<h3>Installing Sparks Manually</h3>
@@ -83,19 +94,27 @@
/system
/sparks
..../example-spark
-......../config
-......../libraries
+......../1.0.0
+............/config
+............/libraries
</pre>
</li>
<p>Now your spark is installed! Try this from within your application:</p>
<pre>
-$this->load->spark('example-spark/1.0.0'); # Don't forget to add '/[version]' if you added a version folder!
-$this->example_spark->printHello(); # echo's "Hello from the example spark!"
+$this->load->spark('example-spark/1.0.0'); # Don't forget to add the version!
+$this->example_spark->printHello(); # echo's "Hello from the example spark!"
</pre>
</ol>
+<p>
+ You can also autoload sparks in your application's config/autoload.php:
+</p>
+<pre>
+$autoload['sparks'] = array('example-spark/1.0.0');
+</pre>
+
<p>Lookin' good? Want to contribute? Check out <a href="<?php echo base_url(); ?>make-sparks">Making Sparks</a>.</p>
<?php $this->load->view('global/_new_footer.php'); ?>
@@ -58,6 +58,7 @@
<pre>
/sparks
..../example-spark
+......../1.0.0
</pre>
<p>
@@ -68,13 +69,15 @@
<pre>
/sparks
..../example-spark
-......../config
-......../libraries
+......../1.0.0
+............/config
+............/libraries
..../other-spark
-......../config
-......../libraries
-......../helpers
-......../models
+......../2.1.0
+............/config
+............/libraries
+............/helpers
+............/models
</pre>
<p>
@@ -391,10 +394,6 @@ function birdseed_fetch($username, $n = 10)
a single library, it might be an idea to name your library after
the spark to keep things clear for the end user:
</p>
-<pre>
-$this->load->spark('example_spark'); # Autoloader loads a library named 'example spark'
-$this->example_spark->doSomethingCool();
-</pre>
</li>
<li>
<p>
@@ -420,7 +419,7 @@ function birdseed_fetch($username, $n = 10)
<li>
<p>
<strong>Autoloading:</strong> The spark system allows you to autoload
- anything you need in config/autoload.php. This can make things handy
+ anything you need in config/autoload.php (including sparks). This can make things handy
for the end-user, but don't forget one of the major philosophies of
CodeIgniter: Only include what you need.
</p>

0 comments on commit a6a9eb5

Please sign in to comment.