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 as compared to my application in my local machine. Continue reading
As you know one would generate the cakephp table schema as:
$ cake schema generate
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.
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 install laravel to their local xampp or wamp setup. All you need is having a basic knowledge of command line run and setting system variable paths. Continue reading
I am in a Task model.
I build following options to load the Task and associated User model data. Continue reading
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 application. Continue reading
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 tag but it wont take care of the left-right borders and radii. Continue reading
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 would work as a “ago in words” kind of function as well. Continue reading
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 limited number of decimal points. Continue reading
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 up with. I think it may help some one there. Continue reading