Archive for the ‘Recipe Manager’ Category

jQuery solution to the add ingredient row problem

Sunday, January 4th, 2009

Due to the fact that I could not find a reasonable solution within the CakePHP framework to add a new row of ingredient list inputs to recipe form I solved the problem using jQuery. This is the script. $('#add_ingredient_row').click(function() { // Clone the last row of the table. var clonedRow = $("#ingredient_list tr:last").clone(); // Generate an ...

Basic user authentication

Saturday, January 3rd, 2009

Today I got the basic user authentication going for the Recipe Manager using this tutorial. Users Controller class UsersController extends AppController { var $name = "Users"; //var $helpers = array('Html', 'Form'); function index() { } function beforeFilter() { $this->__validateLoginStatus(); } function login() { if(empty($this->data) == false) { if(($user = $this->User->validateLogin($this->data['User'])) == true) { $this->Session->write('User', $user); $this->Session->setFlash('You\'ve successfully logged in.'); $this->redirect('/recipes/'); exit(); } else { $this->Session->setFlash('Sorry, the information you\'ve entered is incorrect.'); exit(); } } } function register() { if (!empty($this->data)) { //Sanitize::clean($this->data); $this->data['User']['password'] = md5($this->data['User']['password']); $this->User->create(); // ...

CakePHP so far

Saturday, December 27th, 2008

I have finally started the recipe manager project. I decided upon the CakePHP framework thanks to a recommendation from Anthony. I have found a few places that have some documentation to help get started. Teknoid has some great stuff Google Group I have most of the framework for the application fleshed out. I ...