Created
September 21, 2010 10:48
-
-
Save handlename/589526 to your computer and use it in GitHub Desktop.
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 | |
use_helper('MyJSON'); | |
// アクション内で、配列形式でレスポンス用のデータを入れてます | |
$json = json_encode($sf_data->getRaw('data')); | |
// デバッグ用にフォーマット | |
if(sfConfig::get('app_json_pretty_print')) | |
{ | |
$json = json_format($json); | |
} | |
// マルチバイト文字をエスケープしない | |
if(sfConfig::get('app_json_allow_multibyte')) | |
{ | |
$json = unicode_encode($json); | |
} | |
echo $json; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment