Featured
-
Cakephp - Using Config.php
We can use config.php in cakephp to define const
by harneet.sethi -
Multiple -Language website USING InternationalizationAND Locale
Hii friends, Many of you when you will start ma
by gaurav.singh -
Fetch feeds from youtube in drupal 7
HTML parser and can fetch data from existing URLs.
by rashi.goyal -
Delete files from folder in cakephp 2.X
If anyone wants to delete file from the folder ca
by rashi.goyal -
how to set a custom message using form_alter in Drupal
At times we need to change the message that is dis
by rashi.goyal
Tags
How to browse and show multiple images at the same time in cakephp?
Sometimes we are required to upload multiple images in our CakePHP application and at the same time to show them on that page.
Let's see how we can do it.
In our view file like as we have done in post add file of view. In our form of ty...
Advantage of "loadModel" over "$uses"
Advantage of loadModel over uses
While using "$uses", many unrelated model gets loaded. So it's best practice to use it only when it is needed through out the controller. If you only need it randomly then loadModel(). Another way of loading a...
Cakephp - Using Config.php
We can use config.php in cakephp to define constant which need to be used in our whole project example we have different role id for different users.We can define those user corresponding to their role id and can easily access them through out ...
Delete files from folder in cakephp 2.X
If anyone wants to delete file from the folder can use this code.
App::uses('File', 'Utility');
$file = new File(WWW_ROOT .'subcategory/thumbs/abc.jpg', false, 0777);
if($file->delete()) {
echo "File Deleted";
}
Cakephp - Using multiple database
Many a times we need use multiple database as per the domain or some other reason . We can easily achieve it with the following code in cakePhp.
Write the following code in app->config->database.php
class DATABASE_CONFIG {
publ...
Cakephp - Using Auth
We can use Auth component in cakephp for authentication and authorization objects. Since it easy and secure way to do this.
Write following in your App controller
public $components = array(
'Auth' => array('loginAction...
Simple Cakephp Pagination
Cakephp provides a quick an easy way to paginate data.
In the controller we start by creating the pagination condition as given below :
public $paginate = array(
'limit' => 10,
'order' => array(
...