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 | |
// CakePHP 1.3からflashは戻り値が返るので、自前でechoする | |
if ($session->check('Message.auth')) echo $session->flash('auth'); |
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 | |
var $paginate = array( | |
'Staff' => array( | |
'fields' => array('Staff.id', 'Staff.email', 'Staff.staff_name', 'Staff.status'), | |
'limit' => 10, | |
'order' => array('Staff.id' => 'desc'), | |
'conditions' => array( | |
'Staff.status >= ?' => array( 1 ), | |
), | |
'recursive' => -1, |
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 AppModel extends Model { | |
function equaltofield($check,$otherfield) { | |
$fname = ''; | |
foreach ($check as $key => $value){ | |
$fname = $key; | |
break; | |
} |
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 | |
'password_tmp' => array( | |
'alphanumeric' => array( | |
'rule' => 'alphaNumeric', | |
'message' => '半角英数字で入力して下さい。', | |
), | |
'minlength' => array( | |
'rule' => array('minLength', 8), | |
'message' => '8文字以上で入力して下さい。', | |
) |
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
<p><?php echo $paginator->counter(array('format' => '全 %count% 件中 %start% 件 から %end% 件を表示')); ?></p> | |
<!-- pagination --> | |
<?php if (isset($paginator) && $paginator->hasPage(null, 2)): ?> | |
<div class="pagination"> | |
<ul> | |
<?php if ($paginator->hasPrev()): ?> | |
<li class="prev"><?php e($paginator->first('« 最初', array())); ?></li> | |
<?php e($paginator->prev('< 前へ', array('tag' => 'li'))); ?> | |
<?php else: ?> | |
<li class="prev disabled"><a href="#">« 最初</a></li> |
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 | |
$this->paginate['Content'] = array( | |
'jointo' => array( | |
'Tag', | |
), | |
'conditions' => array( | |
'Tag.id' => array(1,2) | |
), | |
'group' => 'Content.id', |
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 generateCategoryTree($id=0, $column_id='id', $column_name='name') { | |
$tree = array(); | |
if($id == 0) { | |
$children = $this->find( | |
'all', | |
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
<?php | |
$this->set('category_tree', $this->Category->generateCategoryTree()); |
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="clearfix"> | |
<label for="">階層から選ぶ</label> | |
<div class="input"> | |
<div id="sidetreecontrol"> <a href="?#">全て閉じる</a> | <a href="?#">全て開く</a> </div> | |
<ul id="category_tree" class="treeview"> | |
<?php | |
function expand($tree) { | |
$html = ''; | |
foreach($tree as $id => $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
<?php | |
// 今のところエディット時にパースして日付と時間をわけないとだめ。 | |
if (empty($this->data)) { | |
$this->Content->Behaviors->detach('Schedule'); | |
$this->data = $this->Content->read(null, $id); | |
$published = date_create($this->data['Content']['published']); | |
if($published != null) { | |
$this->data['Content']['published_date'] = date_format($published, 'Y-m-d'); | |
$this->data['Content']['published_time'] = date_format($published, 'H:i:s'); |
OlderNewer