This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="debug-info"> | |
<h2><?php echo 'Hello World'; ?></h2> | |
<?php echo $helloWorld; ?><br /> | |
<?php echo $content; ?><br /> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HelloWorldPanel extends DebugPanel { | |
var $plugin = null; | |
var $title = 'Hello World'; | |
function startup(&$controller) { } | |
function beforeRender(&$controller) { | |
$controller->set('helloWorld', 'こんにちは世界'); | |
return 'Hello World!'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MobileIP { | |
var $url = array( | |
'DoCoMo' => 'http://www.nttdocomo.co.jp/service/imode/make/content/ip/index.html', | |
'SoftBank' => 'http://developers.softbankmobile.co.jp/dp/tech_svc/web/ip.php', | |
'AU' => 'http://www.au.kddi.com/ezfactory/tec/spec/ezsava_ip.html', | |
'WILLCOM' => 'http://www.willcom-inc.com/ja/service/contents_service/club_air_edge/for_phone/ip/', | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function checkIPMask($ip, $mask) { | |
list($maskIp, $maskBit) = explode('/', $mask); | |
$maskIpLong = ip2long($maskIp) >> (32 - $maskBit); | |
$ipLong = ip2long($ip) >> (32 - $maskBit); | |
if ($maskIpLong !== $ipLong) { | |
return false; | |
} | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::import('Core', 'DboMysql'); | |
// var $default = array( | |
// 'driver' => 'mysql_innodb', | |
// 'persistent' => false, | |
// 'host' => 'localhost', | |
// 'login' => 'user', | |
// 'password' => 'password', | |
// 'database' => 'database_name', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/workshop/controllers/posts_controller.php b/workshop/controllers/posts_controller.php | |
index 35c892c..6a2d1e2 100644 | |
--- a/workshop/controllers/posts_controller.php | |
+++ b/workshop/controllers/posts_controller.php | |
@@ -5,7 +5,11 @@ class PostsController extends AppController { | |
var $helpers = array('Html', 'Form'); | |
function index() { | |
- $this->Post->recursive = 0; | |
+ $this->paginate = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/workshop/app_model.php b/workshop/app_model.php | |
index ac03cf6..1ceadd2 100755 | |
--- a/workshop/app_model.php | |
+++ b/workshop/app_model.php | |
@@ -36,5 +36,7 @@ | |
* @subpackage cake.app | |
*/ | |
class AppModel extends Model { | |
+ var $recursive = -1; | |
+ var $actsAs = array('Containable'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/workshop/views/posts/edit.ctp b/workshop/views/posts/edit.ctp | |
index f6a1be1..084d94c 100644 | |
--- a/workshop/views/posts/edit.ctp | |
+++ b/workshop/views/posts/edit.ctp | |
@@ -7,7 +7,7 @@ | |
echo $form->input('user_id'); | |
echo $form->input('title'); | |
echo $form->input('body'); | |
- echo $form->input('Tag'); | |
+ echo $form->input('Tag', array('multiple' => 'checkbox')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/workshop/views/posts/add.ctp b/workshop/views/posts/add.ctp | |
index fbc148d..f3c2886 100644 | |
--- a/workshop/views/posts/add.ctp | |
+++ b/workshop/views/posts/add.ctp | |
@@ -6,7 +6,7 @@ | |
echo $form->input('user_id'); | |
echo $form->input('title'); | |
echo $form->input('body'); | |
- echo $form->input('Tag'); | |
+ echo $form->input('Tag', array('multiple' => 'checkbox')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/workshop/models/user.php b/workshop/models/user.php | |
index 1e751e4..c2dbe8d 100644 | |
--- a/workshop/models/user.php | |
+++ b/workshop/models/user.php | |
@@ -2,6 +2,7 @@ | |
class User extends AppModel { | |
var $name = 'User'; | |
+ var $displayField = 'username'; | |
var $validate = array( |