Open up your command prompt in your app/bin folder;
enter the command;
//non vendor specified
cake bake plugin ContactManager
cake bake plugin Gmcd/ContactManager
Baking the controller for your plugin;
cake bake controller --plugin ContactManager Contacts
cake bake controller --plugin Gmcd/ContactManager Contacts
Baking the Model View and Controller:
cake bake all --plugin Gerrymcdonnell/jokes jokes
Read more here:
Sometimes its very handy to pass a variable to an Element in Cakephp3.
This allows you to customize the element if needed;
To do so simply;
in your view file;
echo $this->element('helpbox', [
"helptext" => "Oh, this text is very helpful."
What does it do?
This will load the element called “helpbox” and pass the value “Oh, this text is very helpful.” to the variable called “helptext” in the element.
Firstly you need to install the Plugin;
In the Model of the object you want to allow uploads to(eg User,Product) add;
public $actsAs = array(
'Upload.Upload' => array(
In the View Form of this action add;
<div class="users form">
<?php echo $this->Form->create('User', array('type' => 'file')); ?>
<legend><?php echo __('Add User'); ?></legend>
echo $this->Form->input('picture',array('type' => 'file','accept'=>'image/*'));
<?php echo $this->Form->end(__('Submit')); ?>
Joining two fields to create one (eg to get somebodys name by combining firstname and surname)
You need to create a “VirtualField” in the model;
public $virtualFields = array('fullname' => 'concat(Patient.firstname, "-", patient.surname)');
Then in your controller, to get a drop downlist;
$patients = $this->Exercise->Patient->find('list',array('fields'=>array('fullname')));
If you are writing code in Notepad++ and using Cakephp youll notice it doesnt highlight .ctp files (CakePhp View Files).
You can fix this quite easily by;
Open teh file called; langs.xml
Scroll down till you see;
<Language name=”html” ext=”html htm shtml shtm xhtml hta”
Add ctp to the end of it;
<Language name=”html” ext=”html htm shtml shtm xhtml hta ctp”
Save it and reopn Notepad++ your .ctp files should now render correctly.
Html 5 Canvas Image Rotation
Every thing you ever wanted to know about rotating an image on a canvas.
Html5 Canvas Framework: KinexticJS Tutorials
Flip an Image:
Channel 4’s superb 4OD allows us irish folks to watch all programs on the site while for other reasons the BBC wont allow anyone outside the uk too.
After a bit of research and googling i found and tried a way that does work at least if your in Ireland. Full credit goes to a boards.ie member but heres how to;
Originally Posted by joeyamg
Looked at various ways of doing this, best free way I’ve found for getting iplayer to work:
Step 1: Download and install the latest stable release of Tor using the default options. Run setup and make sure you’re connected to the network. Green onion will appear in system tray if it is working ok.
Step 2: Download and install mgeni, it’s a browser that uses the Tor network to allow you to choose what country you want to route through.
Little bit slow loading webpages (maybe turn off image loading) but video feed is perfect (I’ve only got a 7mb connection). Much easier than messing with foxy proxy or whatever else.
*Doesn’t work for hulu unfortunately
After you get the above software to work wich is easy enough you should be able to watch programs from the BBC site.
While 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.
Heres a good article on how to get the popular Linux distrubtion “Ubunto” installed on a Windows PC without any hassle on formatting or Dual Booting using Microsofts Virtual PC.