Pages

Thursday, October 11, 2012

Request Data post dari Form

Assalamualaikum
Hai cakelovers semua. Saya akan memberikan sedikit ilmu saya tentang bagaimana caranya mengambil data dari form dengan method Post di Cakephp.
Form di view :
<?php
Form->create('formcari');
echo $this->Form->input('cari');
echo $this->Form->end('cari');
?>

Sekarang kita akses di controllernya


public function action() {
if($this->request->isPost())
{
    $this->set('cari', $this->request->data['formcari']['cari']);
    }
}

Yes, dengan begitu data dari form cari akan diambil di controller denga method post.
dan kita bisa menampilkannya di $cari yang telah kita set di  $this->set('cari', $this->request->data['formcari']['cari']);

untuk lebih jelasnya mari ke official website nya disini.
Sekian tutor singkat mengenai ambil data dari post :) .
Happy coding. ;)

Wednesday, October 10, 2012

cakePHP 2.2.2 release

Halooo halooo cake lovers..
Mulai tanggal 1 september 2012 akhirnya cakephp merilis versi cakePHP 2.2.2

fitur - fitur yang ditambahkan neh :

  • Configure::load() and Configure::dump() are now more consistent, and create a new PhpReader by default.
  • Error messaging is better for when fixture creation fails.
  • Logging on windows has been improved, and log levels are more correct.
  • Generated schema files no longer contain multiple primary keys.
  • Namespaced elements work correctly in the RssHelper now.
  • ( and ) are now correctly handled by TextHelper::autoLinkUrls()
  • Applications can now define LOGS and CACHE constants.
  • Recursive errors in debug() have been fixed in 5.2 and 5.3.
  • requestAction() now more correctly simulates GET requests, when the preceding request is a POST or PUT.
  • ModelValidator state is reset when models are created/saved.
  • Additional mimetypes added for Microsoft Office document formats.
  • Validation::decimal() reworked to fix a few edge cases.
  • Virtual fields containing - are quoted more correctly now.



happy cooking :)