Skip to content

Instantly share code, notes, and snippets.

View sugarHoge's full-sized avatar

sugar.hoge sugarHoge

View GitHub Profile
<?php
require_once 'Zend/Db.php';
//require_once 'debug.php';
class IndexController extends Zend_Controller_Action
{
public function init()
{
$this->view->msg = "";
<?php
/**
* AbstractClassクラスに相当する
*/
abstract class AbstractDisplay {
/**
* 表示するデータ
*/
private $data;
@sugarHoge
sugarHoge / new_gist_file
Created June 11, 2013 02:48
■■■ブックマーク■■■
これだけ覚えれば誰でも使えるjQuery Mobile
http://w.builwing.info/2012/04/19/%E3%81%93%E3%82%8C%E3%81%A0%E3%81%91%E8%A6%9A%E3%81%88%E3%82%8C%E3%81%B0%E8%AA%B0%E3%81%A7%E3%82%82%E4%BD%BF%E3%81%88%E3%82%8Bjquery-mobile/
レスポンシブWebデザインでテーブルを使う時の小技
http://design-spice.com/2012/11/01/responsive-table/
HTML5 + jQuery Mobile - 画面遷移
http://haraki.jp/blog/blog.cgi?id=41
@sugarHoge
sugarHoge / Controller
Created June 11, 2013 14:31
SELECT⇒結果(連想配列)⇒View
<?php
require_once 'Zend/Db.php';
class MainController extends Zend_Controller_Action
{
public function init()
{
}
public function indexAction()
@sugarHoge
sugarHoge / IndexController.php
Created June 13, 2013 09:14
連動プルダウン
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
$req = $this->getRequest();
$this->url = $req->getBaseUrl()."/".$req->getModuleName()."/".$req->getControllerName();
$this->view->assign('url', $this->url);
@sugarHoge
sugarHoge / 空白のみか?
Created June 14, 2013 07:16
文字チェック
$i_target = mb_convert_encoding($i_target, 'UTF-8', 'JIS-win');
if (strlen($i_target) > 0) {
$trimCount = trim(mb_convert_kana($i_target, "s"));
if (strlen($trimCount) < 1) {
// 空白のみ
}
}
@sugarHoge
sugarHoge / view
Created June 17, 2013 05:14
form action属性
<form method="post" action="/プロジェクト/public/コントローラー/アクション">
include 'ChromePhp.php';
ChromePhp::log('Hello console!');
ChromePhp::log($_SERVER);
ChromePhp::warn('something went wrong!');
<?php
// demo.php
include 'ChromePhp.php';
ChromePhp::log('Hello console!日本語もOK');
@sugarHoge
sugarHoge / 多次元配列
Created June 17, 2013 07:48
配列数分ループして値を取り出す方法
$test03=array(
array('111', '222'),
array('333', '444')
);
foreach ($test03 as $key1 =>$val1) {
foreach ($val1 as $key2 => $val2) {
debug($key2 . "=>" . $val2);
}