Tag Archives: tutorial

Cakephp Tips – Sort Data With the Pagnator Component

If you wanted to sort a Model by a certain field in this case take the field “created” which is a date. We can simply tell cakePHP to pagnate entries by the order they were created by the following example.

More Examples can be found here;
https://www.codeofaninja.com/2013/07/pagination-in-cakephp.html

CakePhp Tip #6: Displaying items that belong to a user

cake-logo

Displaying items that belong to a user:

One of the most common things youll do in cakephp is list items that the user should only see. For example a user should just see their “posts” listed or their “articles” etc.

CakePHP has “Magic Find Types” that can help. For example if i wanted to list all the posts of the user_id =12

In my controller i can create an action as follows;

if i wanted to list all posts of the current logged in user;

To call view this action;

Source and more info;
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html

How to: Create a batch file to open websites

tech-tip-iconWhile at college or work its a real pain when you login to have to open up 3 different websites and maybe 2 more applications.

Well with a simple “batch” file you can do it all. Simply open notepad and paste the following code into it and save it as “.bat” file then double click it to run it and hey presto no more annoying websites to have to type in, feel free to change the website address to what ever you want.

start http://www.gmail.com
start http://www.google.ie
start http://www.irishbloke.net