This file contains 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 | |
phpinfo(); | |
?> |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title> | |
2012/04/27 FuelPHP 勉強会題材 | |
</title> | |
</head> | |
<body> | |
<form> | |
名前:<input type="text" name="name" />(必須)<br /> |
This file contains 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
/* GIST | |
----------------------------------------------- */ | |
div.gist-highlight pre .line span { | |
font-family: Consolas, Monaco, 'Courier New', monospace; | |
font-size: 14px; | |
} |
This file contains 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
\Database_Connection::instance()->connect(); | |
$pdo = \Database_Connection::instance()->connection(); |
This file contains 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_PATH/config/db.php | |
*/ | |
return array( | |
'default' => array( | |
'type' => 'pdo', | |
'connection' => array( | |
'dsn' => 'mysql:host=localhost;dbname=test', |
This file contains 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 echo $severity; ?>! | |
============ | |
<?php echo $type; ?> [ <?php echo $severity; ?> ]: <?php echo $message; ?> | |
<?php echo $filepath; ?> @ line <?php echo $error_line; ?> |
This file contains 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
// APPPATH/views/errors/php_error.php | |
<div style="border: 1px solid #CCC; padding: 10px; background-color: #FFF; color: #333;"> | |
<p style="font-size: 13px; color: #333;"><strong><?php echo $severity; ?>!</strong></p> | |
<p style="font-size: 13px; color: #333;"><?php echo $type; ?> [ <?php echo $severity; ?> ]: <?php echo $message; ?></p> | |
<p style="font-size: 13px; color: #333;"><strong><?php echo $filepath; ?> @ line <?php echo $error_line; ?>:</strong></p> | |
<pre style="font-size: 13px; color: #333; border: 1px solid #EEE; padding: 3px 3px 3px 8px; margin: 0;overflow: auto;"><code><?php | |
if (is_array($debug_lines)): | |
echo ($error_line - 1).":\t".e(trim($debug_lines[$error_line - 1]))."\n"; | |
echo "<strong>{$error_line}:\t".e(trim($debug_lines[$error_line]))."</strong>\n"; |
This file contains 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 Myfieldset extends \Fieldset | |
{ | |
/** | |
* フォーム要素をviewで使いやすい配列で取得 | |
*/ | |
public function getFormElements($open = '', $hidden = array()) | |
{ | |
if (is_array($open)) { | |
$attr = $open; |
This file contains 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
class Controller_Welcome extends Controller | |
{ | |
public function action_index() | |
{ | |
$fieldset = Myfieldset::forge('sample'); | |
$fieldset->addTextForNumeric('age', '年齢'); | |
$fieldset->addRadioWithBr('gender', '性別', array(1 => '男', 2 => '女')); | |
$fieldset->addRadioInline('season', '一番好きな季節', array(1 => '春', 2 => '夏', 3 => '秋', 4 => '冬')); | |
$view = View::forge('welcome/index'); | |
$view->set_safe(array('form' => $fieldset->getFormElements('post_url'))); |
This file contains 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 echo $form['open']; ?> | |
<h2>何歳やねん?</h2> | |
<table class="table table-bordered"> | |
<tr> | |
<th class="span2"><?php echo $form['age']['label'];?></th> | |
<td><?php echo $form['age']['html'];?> 歳</td> | |
</tr> | |
</table> |
OlderNewer