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 | |
| public function formatDate($date, $dateFormat='', $timeFormat='') | |
| { | |
| $_dateMap = array ( '%B %e, %Y'=> 'F d, Y', | |
| '%A, %B %e, %Y' => 'l F d, Y', | |
| '%m/%d/%Y' =>'m/d/Y', | |
| '%d/%m/%Y' => 'd/m/Y' | |
| ); |
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 Model_User extends Model { | |
| /** | |
| * | |
| * Define the array of rules to be validated against | |
| * the signup information | |
| * @return array rules | |
| */ | |
| public function rules() { |
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
| function numberReplace(s,d) { | |
| return s.replace (/\.?\d[\d.,]*/, d); | |
| } | |
| alert(numberReplace('25 $',12)); |
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
| var obj = $.parseJSON(msg); | |
| for(var key in obj){ | |
| alert(obj[key]); | |
| } |
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 defined('SYSPATH') or die('No direct script access.'); | |
| class Controller_Sample extends Controller | |
| { | |
| public function action_index() | |
| { | |
| $testConfig = Kohana::config('test'); | |
| } | |
| } |
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 Controller_Foo extends | |
| { | |
| public function action_foo() | |
| { | |
| $ext_response = Request::factory('http://site.com/foo/bar/bas') | |
| ->execute() | |
| ->response; | |
| } |
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
| tinyMCE.activeEditor.getContent() |
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
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| (function($){ | |
| $.fn.qr = function(){ | |
| var url = $(this).attr('href'); | |
| var size= 4; | |
| return 'http://qrcode.kaywa.com/img.php?s='+size+'&d='+url; | |
| }; |
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 | |
| /** | |
| * @param mixed $query Query to be prepared for executing | |
| * multiple times | |
| * Usage "SELECT * FROM table_name WHERE column = ? " | |
| * "INSERT INTO table_name(field1,field2) VALUES(?,?) "; | |
| * returns true if the query is a valid mysql statement else throws an | |
| * exception | |
| * | |
| */ |
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 | |
| $array = array(1,2,3,4,5); | |
| $v= 4; | |
| $result = array_filter($array,function($n) use(&$v){return $v === $n;}); | |
| print_r($reslt); | |
| ?> |