InimistTech Blogs

Web & Mobile App Tech Weblog

  • Home
  • Laravel
  • React
  • Javascript
  • Linux
  • PHP
  • git
  • WordPress
  • Hindi to Unicode

Category: CakePHP

CakePHP: switching between multiple databases

Arvind KumarCakePHPLeave a Comment on CakePHP: switching between multiple databases

Relating to a post I submitted a while back, along with creating a data connection on the fly I had to switch between two connections. That is, file based default connection and a dynamic connection based on user. Here is…

Read More→

Cakephp generate plugin schema

Arvind KumarCakePHPLeave a Comment on Cakephp generate plugin schema

As you know one would generate the cakephp table schema as: $ cake schema generate

CakePHP Create Datasource on the fly

Arvind KumarCakePHP1 Comment on CakePHP Create Datasource on the fly

Want to switch between different databases in a CakePHP action? Do you want to use different database for different clients or sites? Don’t worry the solution more simpler than you thought it to be. Following this link and few other similar…

Read More→

Contain and selected fields of model with User _attachAttributes

Arvind KumarCakePHPLeave a Comment on Contain and selected fields of model with User _attachAttributes

I am in a Task model. I build following options to load the Task and associated User model data.

CakePHP deleteButton when SoftDelete Behavior in Effect

Arvind KumarCakePHPLeave a Comment on CakePHP deleteButton when SoftDelete Behavior in Effect

Here is a piece of code placed as a helper function. Useful to create a delete button/link while having SoftDeleteBehavior enabled for a Model. For example, placed in data management page (view page such as admin_index.ctp or index.ctp) of your…

Read More→

Form Helper: custom decimal field format in number field

Arvind KumarCakePHPLeave a Comment on Form Helper: custom decimal field format in number field

I have a database table field defined as decimal(10,5). I want to use it for various purposes so I don’t want to change the datatype. In most of the forms however I want to keep this field showing none or very…

Read More→

ACL: Checking Permissions in Views, Fixed

Arvind KumarCakePHPLeave a Comment on ACL: Checking Permissions in Views, Fixed

Following the post (http://goo.gl/PLeNJR) for ACL: Checking Permissions in Views like some others I faced a “undefined index User…” and some other PHP warnings when trying to implement this example. After doing some testing following the working code I came…

Read More→

Containable with mixed arguments, the CakePHP Beauty!

Arvind KumarCakePHPLeave a Comment on Containable with mixed arguments, the CakePHP Beauty!

Here’s an example of CakePHP Containable behaviour. Although, it was not a very complex find call but the beauty of the containable is this that you can fetch records using “tricky ways” which normally may not be possible with straight…

Read More→

How to paginate a different model with options in CakePHP

Arvind KumarCakePHPLeave a Comment on How to paginate a different model with options in CakePHP

Assume you are on a LogsController which has Log as the default model and wanted to paginate another model LogColumn. Here’s How it goes:

How to get model name from controller in cakephp

Arvind KumarCakePHPLeave a Comment on How to get model name from controller in cakephp

Suppose we have $controller as an object for our controller class. We can do the following to get the model class: [code]$modelName = $controller->modelClass;[/code]

Posts navigation

Previous 1 2 3 4 … 7 Next
  • Useful Linux Commands
  • Enlighter Example - CSS
  • Disk Space Usage Commands
  • Top Directory Linux commands

Recent Posts

  • Build Reusable Components in React
  • Introduction to Node.js for Beginners
  • Getting Started with the MERN Stack: A Beginner’s Guide
  • Introduction to Node.js for Beginners
  • How to Modify WooCommerce Templates

About Arvind

Arvind Thakur is a Full Stack Web Developer. He founded and runs a Software Development company by the name Inimist Technologies in Chandigarh, India. >> know more
Copyright © All rights reserved.
Blog Kit by WP Charms
Facebook
fb-share-icon
LinkedIn
Share
WhatsApp
Follow by Email
Twitter
Post on X
Reddit
Pinterest
Instagram
RSS
Telegram