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 | |
|- classes | |
|- field | |
| - slug.php // class Field_Slug | |
| | |
|- jelly | |
| - meta.php // class Jelly_Meta | |
| | |
- jelly.php // class Jelly |
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 | |
$category = Jelly::factory('category'); | |
$category->name = 'Contoh kategori ke-2'; | |
$category->save(); |
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
id | name | slug | |
-------------------------------------- | |
1 | contoh kategori | contoh-kategori |
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 Model_Category extend Jelly_Model | |
{ | |
public static function initialize(Jelly_Meta $meta) | |
{ | |
/** | |
* defaultnya sih categories, tapi kalo kita punya table berbeda, | |
* pake method table() buat definisi nama table | |
*/ |
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 | |
Jelly::select('log')->where('log_date', 'BETWEEN', array('2010-10-03', '2010-10-05')); |
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
SELECT log_activity FROM logs WHERE log_date BETWEEN '2010-10-03' AND '2010-10-05'; |
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 | |
public function save($model, $value, $loaded) | |
{ | |
if ($loaded) | |
return $value; | |
else | |
return $this->set_slug($value); | |
} |
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 | |
public function save($model, $value, $loaded) | |
{ | |
return $this->set_slug($value); | |
} |
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
HTTP/1.1 200 OK | |
Server: nginx/0.8.54 | |
Date: Tue, 03 Jul 2012 02:06:55 GMT | |
Content-Type: application/json | |
Transfer-Encoding: chunked | |
Connection: keep-alive | |
X-Powered-By: PHP/5.3.5 | |
{ | |
"file": "4fedf32c6abe4GosmsPhoto1340783455780ZY86773AIMI4MZ6.jpg", |
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
http -f POST http://host/api/upload user=arie key=my-private-key file@/home/arie/Downloads/GosmsPhoto1340783455780ZY86773AIMI4MZ6.jpg format=json |