Welcome Guest, Not a member yet? Register   Sign In
Announcing Bonfire - A jumpstart for your web apps

[eluser]SmitRay[/eluser]
Thanks bro

[eluser]theprodigy[/eluser]
I just cloned a copy tonight, figured I would try it out.

Everything looks cool, but I noticed a small issue with your ToDo List tutorial.

Your tutorial says:
Quote:Create a new file under todo/models called Todo_model.php. The file should look like...
I had to rename the file to todo_model.php (lower case name) to get it to work. It was giving me an error that it couldn't find the file with the first letter upper-cased.

[eluser]theprodigy[/eluser]
Another thing I noticed:
Your code in the tutorial is passing the $_POST array, and using it to insert into the db. Nothing you do while using form_validation is being done other than required.
Code:
public function index()
  {
      if ($this->input->post('submit'))
      {
          if ($this->create_item($_POST)) // <-- passing $_POST array
          {
              Template::set_message('New ToDo item successfully created', 'success');
          }
          else
          {
              Template::set_message('Error creating new ToDo item.', 'error');
          }
      }

      Template::render();
  }

  //--------------------------------------------------------------------

  private function create_item($vars) // $_POST array
  {
      $this->form_validation->set_rules('description', 'Description', 'required|trim|strip_tags|max_length[255]|xss_clean'); // xss_clean and strip_tags all you want, you're inserting from $_POST, not $this->input->post.

      if ($this->form_validation->run() !== false)
      {
          $data = array(
              'description'   => $vars['description'] // $_POST array
          );

          return $this->todo_model->insert($data);
      }

      return false;
  }

  //--------------------------------------------------------------------

[eluser]theprodigy[/eluser]
One quick question. I went through the tutorial, and go the ToDo backend setup.
I tried to create the front-end, and ran into a small issue.

Steps I took:
1. Created todo.php controller in modules/todo/controllers directory.
2. Put the following code into the todo controller
Code:
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Todo extends Front_Controller {

  public function __construct()
  {
      parent::__construct();

      $this->load->model('Todo_model', 'todo', true);
  }
  
  public function index()
  {
    Template::set('items', $this->todo->order_by('todo_id', 'desc')->find_all_by('deleted', 0));

    Template::render();
  }
}
3. Created the index.php view inside the modules/todo/views/todo directory.
4. Put the following code inside the index.php view file:
Code:
&lt;?php if (isset($items) && is_array($items) && count($items)) : ?&gt;
<h3>ToDo Items</h3>

<table>
  <tbody>
  &lt;?php foreach ($items as $item) : ?&gt;
      <tr>
          <td>&lt;?php echo $item->description ?&gt;</td>
      </tr>
  &lt;?php endforeach; ?&gt;
  </tbody>
</table>
&lt;?php endif; ?&gt;
5. Directed my browser to: localhost/bonfire/todo
6. Recevied the error: 'Unable to locate the file: todo/index.php' (The base template is rendering, but not the content for the template - see screenshot)
Can you please let me know where my error is?
So far, this app looks pretty cool. You can tell you've put quite a bit of work into it. Although maybe a little docs on creating front-end views would be good too (for people like me Wink )

[eluser]Basketcasesoftware[/eluser]
Actually he's looking for refinement suggestions on the docs and peoples' experiences installing and using it. This is supposed to a community project. So far he's been doing almost all the heavy lifting though. I have a few quibbles, but overall it's a excellent extension to the CI framework.

[eluser]theprodigy[/eluser]
[quote author="Basketcasesoftware" date="1306742751"]Actually he's looking for refinement suggestions on the docs and peoples' experiences installing and using it. This is supposed to a community project. So far he's been doing almost all the heavy lifting though. I have a few quibbles, but overall it's a excellent extension to the CI framework.[/quote]
You're right, it is an excellent addition, and I hope I didn't come across as negative, or complaining. It wasn't my intention. I was just pointing out a few areas where the tutorial was giving incorrect information. If need by, I can fix those areas and submit them to the github repo.

Also, Basketcasesoftware, since it seems like you have had a little experience using this, could you help me out with my third posting, which is actually a question?

[eluser]Basketcasesoftware[/eluser]
@theprodigy - I've had a LOT of experience with it so far. %-P I'm trying to sort through your description of the problem now. What I've seen so far SHOULD be working, but I'm probably missing something. What are you using to run it? XAMPP? LAMPP? WAMPP? MAMPP?

Doh! :ohh: I see it now. If I read it right you put your view file in modules/todo/views/todo
Am I right? If so, knock of that last "todo" in your path. The view file should be at modules/todo/views

[eluser]theprodigy[/eluser]
[quote author="Basketcasesoftware" date="1306745458"]@theprodigy - I've had a LOT of experience with it so far. %-P I'm trying to sort through your description of the problem now. What I've seen so far SHOULD be working, but I'm probably missing something. What are you using to run it? XAMPP? LAMPP? WAMPP? MAMPP?

Doh! :ohh: I see it now. If I read it right you put your view file in modules/todo/views/todo
Am I right? If so, knock of that last "todo" in your path. The view file should be at modules/todo/views[/quote]

Thanks! That fixed it.

I was under the assumption that it was setup as
Quote:views/[controller_name]/[function_name].php
but I guess it doesn't work that way for the public-facing side.

And to answer your first question, I am using just straight LAMP (Ubuntu machine, with Apache, MySql, and PHP installed), not any package software.




Theme © iAndrew 2016 - Forum software by © MyBB