PHP frameworks

From Wildsong
Revision as of 19:46, 4 April 2015 by Brian Wilson (talk | contribs)
Jump to navigationJump to search

Currently I am only looking at Cake. There is a book. http://it-ebooks.info/book/2489/ Of course, it was written for Cake 2 and Cake 3 was released a week ago. That's how it goes with computer books.

There are about a zillion other PHP frameworks. But I started here. Today.

Cake.php

I grabbed the source by cloning from Git. https://github.com/cakephp/cakephp.git Then I read the docs page and realized all I need to get started is Composer. Composer is a dependency manager.

# Required for Cake. Can't be installed by Composer.
sudo apt-get install php5-intl

cd /var/www/testing
# Get composer
curl -sS https://getcomposer.org/installer
# Create a new project called "firewall".
php composer.phar create-project --prefer-dist cakephp/app firewall

I set DOCROOT to firewall/webroot and... Now I wonder if it works... http://testing.wildsong.biz/index.php YAY, it does! It generates a report that's all green except for a database. I want to connect it to a database since that is what this is for... I already had a 'firewall' database so I added a user 'cake_firewall', had phpmyadmin generate a password, and copied the relevant information into firewall/config/app.php

Now it's all green. So far, so rapid!

"To change the content of this page, edit: src/Template/Pages/home.ctp" Yes I have done that already.

Cake tutorials (copied from the original version of the page)

  1. Cake docs http://book.cakephp.org/3.0/en/
  2. Bookmarker tutorial http://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/intro.html
  3. Blog tutorial http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/blog.html

What is the Front Controller pattern? https://en.wikipedia.org/wiki/Front_Controller_pattern It means there is one file index.php that acts as the window into the application. So, it's like this Wiki. Every URL starts with index.php? and it's the REST of the URL that determines what page comes up.

Knockout.js

Can I use Cake + Knockout? Yes. http://stackoverflow.com/questions/6456982/cakephp-knockout-js