CakePHP 框架的工具

euromark 0fae8539e6 remove group test file 13 年 前
Config 449b9599ad KeyValue Behavior 13 年 前
Console 3ea7bef930 coding standards 13 年 前
Controller 8283a5cc48 refactor IMAP to work with inline attachments 13 年 前
Lib 2d0b37e194 fixing tests 13 年 前
Locale 560d168a8b qlogin and fixes 14 年 前
Model c2070fef19 fix url generation 13 年 前
Test 0fae8539e6 remove group test file 13 年 前
TestSuite fd397a0730 move files to correct namespace 13 年 前
Vendor f8b6d45ca4 rtim files for coding standards 13 年 前
View 1630ca2d85 more tests 13 年 前
webroot bbb8cacfa2 doc update 14 年 前
README.md 8283a5cc48 refactor IMAP to work with inline attachments 13 年 前
USAGE 5c8f26c714 usage update 13 年 前
composer.json daae04ad12 adding composer.json 13 年 前

README.md

Tools

a cake2.x plugin

This plugin contains several useful tools that can be used in many projects. Please fork and help to improve (bugfixing, test cases, ...)

CODING STANDARDS

How to include

Installing the Plugin is pretty much as with every other CakePHP Plugin.

  • Put the files in APP/Plugin/Tools
  • Make sure you have CakePlugin::load('Tools') or CakePlugin::loadAll() in your bootstrap

You can also use packagist now: https://packagist.org/packages/dereuromark/tools-cakephp

That's it

The basics

MyModel can be extended to use more powerful validation and other improvements:

App::uses('MyModel', 'Tools.Model');

class AppModel extends MyModel {
}

MyHelper can be extended and used this way:

App::uses('MyHelper', 'Tools.View/Helper');

class AppHelper extends MyHelper {
}

The test suite improvements can be used via:

App::uses('MyCakeTestCase', 'Tools.TestSuite');

class SomeClassTest extends MyCakeTestCase {
}

To run any of the console commands (replace [ShellName] and [command]!):

cake Tools.[ShellName] [command]

The models, behaviors, helpers, libs and other classes are used the same way prefixing them with the plugin name:

App::uses('GooglLib', 'Tools.Lib');
App::uses('TimeLib', 'Tools.Utility');
App::uses('GeocodeBehavior', 'Tools.Model/Behavior');
...

Tip: For how to use them, try to find some information in the test cases.