Archive

Archive for the ‘Cakephp’ Category

Strict Standards: Non-static method Configure::getInstance() should not be called statically in

Server problem :
Strict Standards: Redefining already defined constructor for class Object in C:\xampp\htdocs\project\cake\libs\object.php on line 57
Strict Standards: Non-static method Configure::getInstance() should not be called statically in C:\xampp\htdocs\project\cake\bootstrap.php on line 42

 

Solutions :

Please go to the cakephp project directory , then go cake folder and you will see bootstrap.php file

location : yourprojects/cake/bootstrap.php

Find the below statement :
error_reporting(E_ALL & ~E_DEPRECATED);

Replace with below satement :

error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);

 

Problem solved : yes !!!!!

 

Advertisements
Categories: Cakephp, Server Tags:

Strict Standards: Redefining already defined constructor for class Object in cakephp

Server problem :
Strict Standards: Redefining already defined constructor for class Object in C:\xampp\htdocs\project\cake\libs\object.php on line 57
Strict Standards: Non-static method Configure::getInstance() should not be called statically in C:\xampp\htdocs\project\cake\bootstrap.php on line 42

 

Solutions :

Please go to the cakephp project directory , then go cake folder and you will see bootstrap.php file

location : yourprojects/cake/bootstrap.php

Find the below statement :
error_reporting(E_ALL & ~E_DEPRECATED);

Replace with below satement :

error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);

 

Problem solved : yes !!!!!

 

 

Categories: Cakephp, Server Tags:

How to resovle Cakephp Missing Database Table error

November 20, 2011 1 comment

1.Customize the error message

Missing Database Table

Error: Database table pages for model Page was not found.

Notice: If you want to customize this error message, create app/views/
errors/missing_table.ctp

 

2. Sometime if you encounter “Missing Database Table” from CakePHP errors, it might not really be due to missing of some database tables.

What you need to do is simple. Clear the cache folders found in CakePHP. The directory should be /app/tmp/cache.

Clear (delete) all files found in these 3 folders:
– models
– persistent
– views

By right, we should only clear the files in models folder. Just to be on the safe side, I strongly recommend clearing all these 3 folders.

Categories: Cakephp Tags:

How to highlight syntax in .ctp (Cake View) in NetBeans

June 24, 2010 Leave a comment

How to highlight syntax in .ctp (Cake View) in NetBeans .

If you are using NetBeans in version 6.8 (which by the way has support for CakePHP). With a little help provided by the article linked above you’ll be able to have auto-completion for controllers, models etc. If you just need to highlight the syntax, just do this:

* Tools -> Options -> Miscellaneous -> Files * New File Extension (ctp) *

Associate it with PHP That’s it, now your .ctp files should be treated as .php files.

Categories: Cakephp

How cakephp model load dynamically ?

October 12, 2009 2 comments

How cakephp model load dynamically ?

  • Cakephp Model load dynamically without create model or $uses variable.
  • But sometime need without $uses variable for load model in another controller by dynamically.
  • When we want to load model dynamically then we can use this code .

<?php

class CategoriesController extends AppController

{

var $name = ‘Categories’;

function add()

{

$this->loadmodel($dynamicModelName);

if( $this->$dynamicModelName->save($this->data)){

$this->Session->setFlash(‘Your Data Save Successfully’,true);

$this->redirect(array(‘controller’=>’categories’,’action’=>’index’));

}

}

}

?>

Categories: Cakephp

why we use $uses variable ?

September 13, 2009 Leave a comment

$uses variable need for other model include in this controller.

Such as below :

$uses = array(‘User’,’Comment’,’Category’);

Categories: Cakephp