Category Uncategorized

Change To CSS

Initially I tried to implement the Twitter Bootstrap but found that It did not look that great with Cake PHP   So what I have done is edit the CSS in the original Cake PHP files. This is found in the Web root folder and then the CSS file is called “Cake.Generic” I changed the […]

Security measures (Data Sanitization)

I was looking at Security measures that I could implement According to Cake the way it is set up is it should be safe from SQL injection attacks Data Sanitization is what you want to prevent so what I done was use a tutorial which wanted us to put a Function in the APP Model […]

References

Unfortunately due to time constraints and there not really being a lot of great resources out for Cake PHP i was only able to create a basic application Most of the code ,ideas and explanations were all from the following sources : http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.html http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html http://whatis.techtarget.com/definition/model-view-controller-MVC http://www.youtube.com/watch?v=zvwQGZ1BxdM

Conclusion

I have enjoyed using CakePhp as this was the 1st time I have used this Framework The MVC structure logically make sense and after a little while you know where everything should go The application I created was a basic one which did not take long too complete but had quite a lot of functionality […]

Problems uploading to the server!!!Watch out for Syntax Errors !!

Had a little problem uploading the site to the server When uploading a PHP Framework there seems to be 3 things that are the problem : HT Access file 777 Write access permissions Database Connections The HT Access file allows you to prevent access etc to your files a common error I was getting with […]

Controllers

We will now show the important code highlights of the Controllers User Controller We will start again with User which shows you different code for each part you want to do this piece of code corresponds to the Edit View form : public function edit($id = null) { if (!$this->User->exists($id)) { throw new NotFoundException(__(‘Invalid user’)); […]

Models

We will now be showing code highlights from the Models portion of the programme: The User.php Model mostly deals with validation rules for setting up a new User into the database : This function checks if the passwords match when inputting data: public function matchPasswords($data) { if ($data[‘password’] == $this->data[‘User’][‘password_confirmation’]){ return true; } $this->invalidate(‘password_confirmation’,’Your Passwords […]

Views!!!

After baking we now had folders for each of the MVC things it was now time to add the extra pages and start filling it with content For the views they are split into the User view and Review View also you have to save them as .ctp extensions or PHP extensions To get anything […]

Baking the project

Was having some problems with Baking a project using Windows 8 ! This has mostly down to Syntax and having the folder path set incorrectly! Eventually got it set up but I just wanted to do a basic Bake to create Models Controllers and Views and because of the Primary key set up it would […]

Database Design

I have looked at quite a lot of tutorials and articles on Cake so I decided to just try and keep it simple in the beginning and see if I could improve upon it It seems to be generally acceptable that the Primary Key should be called “Id” and if you are wanting to have […]