CakePHP Cookbook updated!
After almost 3 year using the old design, the team decide make a major facelift to the cookbook. They even put local cache function. kudos!
mengetuk keyboard untuk mencari sesuap nasi
After almost 3 year using the old design, the team decide make a major facelift to the cookbook. They even put local cache function. kudos!
Kalau selalu guna if and else, langkah seterusnya mesti tahu ternary condition. ade alternative lain nak guna dalam CakePHP, contoh: /* ife in cakePHP */ ife($condition, $true, $false) jadi, kalau statement ternary tu cam ni: /* ternary condition */ echo ($x)?’x = true’:'x = false’; ble ubah jadi macma ni. mudah sket /* replace ternary [...]
Kalau malas asik nak declare layout di cakephp, aku akan guna code macam ni. /* before Render */ function beforeRender() { parent::beforeRender(); $this->layout = ‘plugin’; …. } lepas tu aku nak tukar stail layout, misalnya nak guna layout “ajax”. jadi aku declare macam ni.. /* children */ function children($id = null) { …. $this->layout = [...]