An Introduction to Views & Templating in CodeIgniter | Nettuts+

Views are a key ingredient in any MVC application, and CodeIgniter applications aren’t any different. Today, we’re going to learn what a view is, and discover how they can be used to create a templating solution for your CodeIgniter projects.The first part of this tutorial will educate complete beginners to CodeIgniter on what a view is, and how to use them in a typical application. The second half will discuss the motivations for finding a templating solution, and guide the reader through the necessary steps for creating a simple, yet effective templating library. Interested? Let’s get started!

via An Introduction to Views & Templating in CodeIgniter | Nettuts+.

Grocery Crud for CodeIgniter

Grocery crud is probably one of the easiest ways to build your database calls for CodeIgniter and its just been updated.

The version 1.2.2 is mostly a maintenance release so it is more about bug fixes.
However, as each version new features has been added:

  • The button “Save and go back to list” that lot of users where expecting . It simply redirects you to the list after saving.
  • The “unset_list” . This functionality does not only unset the list (or else the datagrid), it is also disable the user to access to the list, so this means that any button “go back to list”, “Success go back to list”… e.t.c is not there.

For more you can also take a look of the changes that has been made below:

  • Adding Dutch language.
  • Adding a new method “unset_back_to_list”. Unsets everything that has to do with buttons or links with go back to list message.
  • #28 – Change the hardcoded JavaScripts and CSS with variables.
  • #25 – Adding a new method “unset_list”. Unsets the first list and the ajax_list and gives an exception error for the user that tries to access it.
  • Adding a new button/feature “save and go back to list”. When a user press the button “save and go back to list” it is automatically redirect you to the list page when a successful save is done.
  • Adding the default_per_page at the config file. This specifies the first visit per page that a user should see at the list page. For example 25 rows per page.
  • #13 – The list search and ordering is not working with the n-n relation columns.
  • Small bug fixes:
    • #20 – Pressing tab and enter after adding a date or a datetime field it clears the date.
    • #21 – By default the texteditor transform the utf8 to html entities.
    • #22 – Doesn’t recognize that a tinyint 1 or int 1 can just take a numeric value more than 1.
    • #23 – When we use $crud->where() method it doesn’t work as expected with the flexigrid search.

You can download the new version here.

Codeigniter from scratch

Recently a friend of mine asked me to show them how to build a website! But how can you teach someone with no experience who wants not just a static website but a fully dynamic website.

Not easy to answer, but a start would be to point them towards a framework which is not only very well documented but is pretty easy to learn. Don’t get me wrong php take years to master, but frameworks take the brunt out of most of the coding and allow you to concentrate on what you want to create without having to worry about all the security etc.

Before I even begin to help my friend to start coding the website in question I am going to point her to the tutsplus websites so she can view some great tutorials. The tutsplus websites are excellent with a wide range of subjects covered. But for my purposes considering I am going to be building this website along side my friend the CodeIgniter from scratch series will be the first port of call. This is going to be the starting point for her where she will be able to learn the basics in her own time!

I will continue to post on how the website build goes. Hopefully it will not be to stressful to get it completed!


Codeigniter CRUD

I have been working with Codeigniter for some time now and have I think finally found the solution to CRUD with out having to code it all myself! Grocery CRUD does all the hard work for you, but also allows custom code so you can add to the library yourself. It certainly cuts down development time and along with Ion Auth which after testing and working with other auth libraries I feel is the best one available makes your CMS easy to use and secure.