Questions tagged [cake-bake]

Cake bake is a feature in Cakephp that auto-generates php and html code which provides a set of webpages to provide basic CRUD features based on the database schema.

15 questions
8
votes
1 answer

Configure cake bake to enable cascading delete

I am using cakephp v3.3.3 After using cake bake to auto-generate code, I have this php file BallsTable.php which has the initialize() function below; public function initialize(array $config) { parent::initialize($config); …
user6064424
1
vote
0 answers

PHP Fatal error: Your PHP version must be equal or higher than 5.6.0 to use CakePHP

I am running a self-administrated 1and1 dedicated server: CentOS 6.10 (Final) Linux 2.6.32-504.30.3.el6.x86_64 and getting the following error: "PHP Fatal error: Your PHP version must be equal or higher than 5.6.0 to use CakePHP". My initial…
smoeckel
  • 13
  • 5
1
vote
1 answer

How to create AppController in a Admin area in CakePHP 3

I created Admin area by setting prefix "admin" in routes.php file: Router::prefix('admin', function ($routes) { // All routes here will be prefixed with `/admin` // And have the prefix => admin route element added. …
Arvind K.
  • 1,184
  • 2
  • 13
  • 27
0
votes
1 answer

Unable to get Bake Console working and all answers are outdated

I have a CakePHP project in C:/xampp/htdocs/cms2 I'm trying to use bake console, but when I run "bin/cake" in the command prompt it says that 'bin' is not recognized as an internal or external command, operable program or batch file. I followed…
Subnom
  • 57
  • 2
  • 11
0
votes
1 answer

The property name of the controller does not match the one specified by bake (CakePHP4)

i have created a table named "foo_logs" by bake migrations. and then, created model and controller named "FooLogs" by bake. Now, the model and controller have been created. The controller has a property called "$FooLogs" (bake wrote). i tried to get…
0
votes
0 answers

CakePHP Bake :: Create Element file on bake command

I've created a plug-in, and inside that plug-in I've got a custom bake template. I'd like to create an Element file _head.ctp inside the /src/Template/Element/ folder when I execute the bake command. The element file will consist of a code:
user2136790
  • 61
  • 1
  • 2
  • 6
0
votes
1 answer

CakePHP Bake templates controller

I'm creating a custom bake template and I'd like to fetch DB table column type, and comments on a controller file location: Template\Bake\Element\Controller\index.twig, when I'm using code {% set fields = Bake.filterFields(fields, schema, modelObj)…
user2136790
  • 61
  • 1
  • 2
  • 6
0
votes
1 answer

Getting a error when tring to bake it. #cakephp

tried creating small DB and to bake it. but getting an error. c:\xampp\htdocs\cakeBlog>bin\cake bake Exception: Plugin DebugKit could not be found. In [C:\xampp\htdocs\cakeBlog\vendor\cakephp\cakephp\src\Core\PluginCollection.php, line 140]
Sanka
  • 13
  • 2
0
votes
1 answer

CakePHP Bake from different templates when using prefix

When I currently use ./cake.bat bake template Genres or ./cake.bat bake template Genres --prefix admin, then the templates are used from these…
0
votes
1 answer

Cakephp 3 table-prefix in cake bake

How to set global prefix for database tables in cakephp3? I need to insert a prefix for the table. Can the table prefix be used in Cake Bake?
Dvd74
  • 53
  • 12
0
votes
2 answers

CakePhp : Cake bake doesn't work on Ubuntu. (PDOException)

I'm trying to run Cake Bake on Ubuntu. To be clear : The Environment, Filesystem, Database and the DebugKit are Ok as it is mentioned on the first page generated by CakePhp. The "bin/cake bake" shows this message : PHP Warning: PHP Startup:…
Zied Hf
  • 491
  • 3
  • 10
  • 30
0
votes
1 answer

Is there a way I could use both cake bake consoles for CakePHP 2.x and 3.x respectively, at the same time?

I got started with my new CakePHP 3.3.9 project today. As usual I wanted to create a few scaffold using cake bake command. As I already had a CakePHP 2.5.5 setup in my machine. I still needed it and its cake bake commands to run to create any thing…
Arvind K.
  • 1,184
  • 2
  • 13
  • 27
0
votes
2 answers

cakephp 3 query is not executing

I am new in cakephp3. I am trying to execute below query but its showing me error. $lifeinsurances = TableRegistry::get('LifeInsurances')->find("all"); $life_insurances = $lifeinsurances->find() ->join([ 'table' => 'institutions', …
silentcoder
  • 992
  • 3
  • 9
  • 21
-1
votes
1 answer

CakePHP 3.4 foreign key not work

I have a simple structure of tables: CREATE TABLE `programs` ( `id` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `key` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `user_id` int(30) DEFAULT NULL, `installation_date` date DEFAULT…
Andrew
  • 311
  • 1
  • 7
-3
votes
2 answers

CakePHP 2.x - Syntax errors when baking views. Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting identifier (T_STRING)

When attempting to bake views, I consistently get stopped with syntax errors as follows: Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting identifier (T_STRING) in /vagrant/lib/Cake/Console/Templates/default/views/index.ctp on…
ctlockey
  • 333
  • 3
  • 12