Welcome Guest, Not a member yet? Register   Sign In
new to everything
#1

I am trying to figure out a CMS and was drawn towards grocery/CI. I went through the tutorials just fine but they use things like function _example_output which I think is in example.php. Maybe some other stuff. As I try to make my own DB and such, the examples make calls to those things but they are never discussed in the tutorials, they just call it. Is there a tutorial that starts from scratch and builds something useable?


This one is called the simplest but its calling another script. what if I wanted to use it for say cars?

function offices()
{
$output = $this->grocery_crud->render();

$this->_example_output($output);
}

Do I need to wrap it in anything? where do I save the file. How do I call it from a browser?
Reply
#2

(This post was last modified: 02-25-2015, 02:09 PM by whiteatom.)

Sounds like you need to go back and read some of the more general CI examples. All your page logic functions go in a controller file.. then the routing system of CI takes

Code:
http://site.com/directory/offices

and runs Directory::offices() from /application/controllers/directory.php

I found the intro examples got me from "huh?? what goes where?" to app development in about 20 mins.

Good luck!

whiteatom
Reply
#3

I have not heard of Grocery CRUD, but it sounds like it's a third-party library. CRUD stands for CReate, Update, and Delete. It's the basic operations of putting data into a database. It might be better to just learn a little Codeigniter first, without any additional extras.

Like whiteatom says, your URL might look like this:
http://mysite.com/my_codeigniter/cars/show_specs/42

When you try to go to that URL, Codeigniter will interpret that as "look for the file Cars.php in the controllers folder, then execute the show_specs() function in that file, and give it the value of 42 (which is probably the database ID for a particular car)."

If you're new to programming and PHP as well, check out these tutorials.
http://www.w3schools.com/php/default.asp
http://www.webmonkey.com/2010/02/php_tut...beginners/
http://php.net/manual/en/tutorial.php
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#4

I just did the tuts and I have a meh idea on how it works but there is so much going on in the example. Any chance you could rip out all the example files and do the one line tutorial so I can look at the structure without all the fluff.
Reply
#5

Ryan, are you talking about plain Codeigniter or Grocery CRUD? They are two different things. Most of us can help you with Codeigniter questions, but Grocery CRUD questions, well, they require someone who uses and knows Grocery CRUD.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#6

sorry, I was referring to grocery. I'm new to CI too so this is a learning curve for me.grocery seems to be a ridiculously simple way of making interactive databases without the back end stuff. It is looking very promising for rapid development so I am trying to figure it out. I just started with fresh CI files and grocery files and going to try to figure this out. I just noticed the lessons in the tutorial makes up the file that was causing the most headache so I am going to start removing functions one by one and try to reveal the core.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB