PHP frameworks: Difference between revisions
Brian Wilson (talk | contribs) mNo edit summary |
Brian Wilson (talk | contribs) |
||
Line 40: | Line 40: | ||
== Cake plugins == | == Cake plugins == | ||
Always have to have lots and lots of plugins http://plugins.cakephp.org/packages | |||
=== Cake User plugin === | === Cake User plugin === | ||
I want my firewall to be viewable by users and editable by admins and inaccessible to anyone else, so this is high on my list of needs. | I want my firewall to be viewable by users and editable by admins and inaccessible to anyone else, so this is high on my list of needs. I watched a youtube video on CakeDC so I am trying theirs. | ||
The instructions in Installation.md are wrong, at least for Cake 3.0. | |||
# Instead of addeding '''CakePlugin::load('Users');''' to bootstrap.php, just use '''Plugin::load('Users');''' | |||
# The cake command is now in the bin/ directory, not Console/ | |||
# The cake 'schema' command is absent. | |||
# The migrations command "bin/cake Migrations.migration run all --plugin Users" does not work because there is no 'run' command. | |||
== Knockout.js == | == Knockout.js == | ||
Can I use Cake + Knockout? Yes. http://stackoverflow.com/questions/6456982/cakephp-knockout-js | Can I use Cake + Knockout? Yes. http://stackoverflow.com/questions/6456982/cakephp-knockout-js |
Revision as of 22:22, 4 April 2015
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" using the Cake application skeleton 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)
- Cake docs http://book.cakephp.org/3.0/en/
- Bookmarker tutorial http://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/intro.html
- 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.
Cake plugins
Always have to have lots and lots of plugins http://plugins.cakephp.org/packages
Cake User plugin
I want my firewall to be viewable by users and editable by admins and inaccessible to anyone else, so this is high on my list of needs. I watched a youtube video on CakeDC so I am trying theirs.
The instructions in Installation.md are wrong, at least for Cake 3.0.
- Instead of addeding CakePlugin::load('Users'); to bootstrap.php, just use Plugin::load('Users');
- The cake command is now in the bin/ directory, not Console/
- The cake 'schema' command is absent.
- The migrations command "bin/cake Migrations.migration run all --plugin Users" does not work because there is no 'run' command.
Knockout.js
Can I use Cake + Knockout? Yes. http://stackoverflow.com/questions/6456982/cakephp-knockout-js