I had a directory named sites added to my git repository. As it contained a bootstrap file having names of each new domain in multiple sites setup hosted in the single CakePHP application it contained different domain entries and folders…
Cakephp generate plugin schema
As you know one would generate the cakephp table schema as: $ cake schema generate
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…
Install Laravel on Windows – 3 minutes install
Install Laravel on Windows – 3 minutes install Install laravel via composer installer on windows xampp or wamp Laravel 5 can be installed via composer on all operating systems like Windows, ubuntu, mac. Using the following quick guide one can…
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
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…
Bootstrap 3 List group horizontal
This page http://goo.gl/262QmJ has a css to make a list-group floating horizontally and sticking together like it does for list-group to render vertically by default. In order to float list-group-items float horizontally one may add a “list-inline” style to UL…
Fully-formatted Time Difference between two Dates
An useful php function to calculate a time difference between two dates given in sql format. If the newer date is not passed as second argument it would calculate the different between the old date and current time. So it…
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…
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…