Parris Studios


Making Your Own Computer
Associations in CakePHP

19Jul

Making My CMS with CakePHP

if ($error):
echo "
Login denied. Please try again.

";
endif;
echo $form->create('Member',array('type' => 'post', 'action' => 'login', 'id' => 'MemberLogin'));
echo $form->inputs(array('Member.email','Member.password','legend' => 'Member Login'));
echo $form->end('Login');
?>

6 lines of code (if even want to call it that). For a login form with email field, password field, submit button and form opening and closing tags. It also adds in the correct labels for each form field, css div labels and a legend div around all the inputs. If i wanted I could make an entire table go into the fields just by specifying a model name, and then adding an array to exclude the columns I don’t want in there.

This is what I was working on today. After a little bit of trouble to figure out what was going on I quickly realized everything in CakePHP is about 50x easier that I think it is going to be. It almost feels like I am cheating on normal PHP with its better looking older sister. Thus far I have not written any sql my self and I already have linked up 5 database tables together so that when I look up info on say an event, the pictures(which exist within a gallery) come up. Also it brings up who wrote event or article or whatever. I realize this is a lot like the ruby on rails model, but you know its awesome none-the-less. I can’t wait to get this CMS out of the way so I can start sprucing it up with some cool ajax things that cake has built in.

Right now I am working on using their sanatize classes to prevent SQL injection and their validation classes to help with user sign up! This is truely awesome!
I am currently using Cake PHP 1.2 RC2. Bottom line… It rocks!

Share
Tags: Cake, CMS, form, framework, login, Server Side
This entry was posted on Saturday, July 19th, 2008 at 10:59 am and is filed under Server Side. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Click here to cancel reply.

You must be logged in to post a comment.



  • Home
  • ABOUT
  • WORKS
  • ARCHIVES
  • CONTACTS

Categories

  • Game Development
  • JS/Flash
  • Music
  • Server Side
  • Technology and News
  • Webapps
  • Websites

Meta

  • Register
  • Log in
  • W3C Page
  • XFN
  • WordPress

Recent Posts

  • ReactJS workflow with Mocha, JSDom, Gulp, Browserify, CoffeeScript and SublimeText
  • Analysis of Spotify’s Discover Page
  • Pro tip: DONT use mso conditionals for emails
  • Passing variables into a function before and after it is called in JavaScript (Partial Application)
  • Javascript Namespacing/Classes/Debugging etccc….
  • A fresh start

Archives

  • August 2014
  • September 2013
  • October 2012
  • August 2012
  • July 2012
  • January 2011
  • September 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • June 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008

Links

  • Alex Tsui
  • Chris Archibald
  • Corey Richey
  • CS Club SJSU
  • David Alves
  • Development Blog
  • Documentation
  • Earcandy Cabs
  • Edgar Miranda
  • Game Dev Club at SJSU
  • Let’s Woosh
  • Plugins
  • Spectraflex
  • Suggest Ideas
  • Support Forum
  • Themes
  • Victor Frandsen
  • WordPress Planet
Parris Studios is proudly powered by
WordPress, Entries (RSS) and
Comments (RSS)