Most voted "cakephp" questions
Cakephp is a framework written in PHP whose main objectives are to provide a framework that enables PHP programmers of all levels to develop robust applications quickly, without losing flexibility. Cake-PHP utilizes well-known software engineering concepts and design standards such as Activerecord, Association Data Mapping, Convention on Configuration, Front Controller and MVC (Model-View-Controller).
Learn more…376 questions
Sort by count of
-
0
votes3
answers373
viewsReset button on the form
I want to reset all fields of a form using Cakephp framework. What happens is the following, the sign up button is only enabled if the user marks the checkbox to accept. If he clicks the clear…
cakephpasked 9 years, 2 months ago André Nascimento 1,258 -
0
votes1
answer33
viewsRetrieve specific field of a primary key via get()
I am facing a problem at the time of recovering a specific field of primary key from my database via get(). I have a primary key with two fields: ('Id', 'Idcontrato'), however, I have not found a…
-
0
votes1
answer24
viewsURL not found in Cakephp
I’m using Cakephp’s Bake to facilitate development, I’ve analyzed the Models and Controllers it generated and they’re okay. Follow line of index method in one of the controllers. public function…
-
0
votes1
answer25
viewsUpdate a model’s attribute by another cakephp’s controller
[SOLVED] I have a business logic as follows, when the user changes an attribute to paid (change from 0 to 1) I need him to update the balance value of another model. when the user changes the status…
-
0
votes1
answer55
viewsCakephp 3 Debugkit
In Cakephp 2 I usually enable/disable Debubkit by Appcontroller, according to the user who is logged in to the system: // AppController -> CakePHP 2 public function beforeFilter(){…
-
0
votes0
answers13
viewsCakephp returns error in Sqlite database Cannot describe users. It has 0 Columns
Please, Using Cakephp 4.2.5, I have an sqlite database of 3 tables and are not empty. When I do on controller: $usersTable = TableRegistry::getTableLocator()->get('Users'); $query =…
-
0
votes0
answers8
viewsHow to run Cakephp Migrations ONLY in my development environment?
I am working on a project that has three different environments: Live (project in production) Staging Development I created a Migration that creates the table teste, however, instead of creating in…
-
0
votes0
answers94
viewsRecursiveness of folders and files stored in the Database - PHP
I have a system using Cakephp, in one of the pages there is the possibility to register folders and recursive files, which are saved in the database. Now, I need to query these folders and files…
-
0
votes1
answer137
viewsHow to Save Form Data to DB with Cakephp
Good Morning I need help because I am creating a form to save only dates...... the view is already created with 4 fields for dates... and there in the controller I’m half lost. I’ve debugged the…
-
0
votes1
answer50
viewsRule in model using str_replace() to replace "," with "."
The rule is not working. I take a real value with "," and want to replace it with "." to save the decimal values in the bank. For example, the value 35.39 reais would be 35.39 in the bank. The rule…
cakephpasked 8 years, 11 months ago André Nascimento 1,258 -
0
votes2
answers143
viewsHow to create function for view?
I’m creating a role in controller UsersController, this function is for users who forget the password. When I try to open the view, returns an error that the function does not exist. The structure…
-
0
votes0
answers31
viewsSaveall cakephp 2x
On my table Escola I have another associated table called EscolaPercentual. And I have a form that has data of the 2 tables, when saving in my action I give a SaveAll in the Model School, which has…
cakephpasked 8 years, 10 months ago Michel Henriq 647 -
0
votes0
answers28
viewsWorking with 3 templates within a 2x cakephp form
I’m dying to do this ,as as I work with 3 models within a form, and the form refers to the main model and the other 2 models are associated with this model. Example: <?php echo…
-
0
votes1
answer27
viewsusing cakephp 2x push array_push
I am trying to add an array that is a return of a database query, this array is nothing more than an add-on I want inside my $this->request->data['Curso'], but the problem is array_push is…
-
0
votes0
answers43
viewsCount function brings different amount according to date parameters passed
I need to take the month and the year twice: to consult the expenses and calculate the amount of expenses found. In the function consultarDespesas, step for the two global variables to subsequently…
cakephpasked 8 years, 10 months ago André Nascimento 1,258 -
0
votes1
answer41
viewsForm via post and pass in beforeSave
I’m not able to send the data via post, is via put. You’re not going through callback beforeSave and when I debug the request in the controller, you’re put. Maybe that’s why you don’t pass callback…
-
0
votes1
answer32
viewsReturn tables with hasMany - Cakephp
In a relationship belongsToMany, when I turn the result into json ends up returning the field _joinData. Would there be some way not to bring him to the appointment or not to display on json using…
cakephpasked 8 years, 8 months ago Jeferson Assis 2,719 -
0
votes0
answers239
viewsIncorrect redirection on hosting / files
A customer’s website started to give "dick" some 3 days ago. The site is http://upimob.com.br/ . When you enter it, it redirects you to a briefcase called "index.html". Folder that has never been…
-
0
votes1
answer28
viewsOld directory still remains
I took a project made in CakePHP from an old server and played on a new one, but the old server path seems to remain in the script. I played all the files in the new and when I enter the URL, it…
-
0
votes1
answer131
viewsProblem using cakephp 2.6 - Undefined index
Good morning friends, I am learning to program on cake recently and I am having some difficulties. Follow models and controllers. Recibo.php (Model) class Recibo extends AppModel{ public $name =…
-
0
votes2
answers89
viewsChanging top of a cakephp page only
I picked up a website for maintenance and he’s on CakePHP (framework that does not work). It does some routes for all the files that are inside the folder view/pages Routes.php…
-
0
votes0
answers45
viewsHow to debug a chunk of code in the model layer in cake php
I need to debug a chunk of code that is in my model but when I add debug($varexemplo) or var_dump or printf for example it does not display anything in the browser! Can someone please help me?…
-
0
votes1
answer143
viewsI cannot validate form in Cake PHP 3
Hello, I’m new to Cakephp 3 and am having problems validating my login.ctp form, error: Undefined variable users in login.ctp. I’d appreciate it if someone could help me validate; login.ctp:…
-
0
votes2
answers54
viewsError converting to vector (->toArray()) in Cakephp
Good night. I’m creating a file function 'src/Model/Table/ProdutosTable.php', using version 3 of Cakephp. The function must return information in a vector of a list of products according to the date…
cakephpasked 8 years, 2 months ago Max Porcento 157 -
0
votes1
answer63
viewsCakephp routine is legend to display data in the view
I’m using Cakephp 2.4.2. I’m not able to understand the slowness to display the data. As the number of records increases in the table, the slower it gets. The table structure is id (int(11)), name…
-
0
votes0
answers105
viewsError in Composer when trying to create a Cakephp project
I’m using a Linux (Ubuntu) virtual machine to develop a Cakephp project. I’ve installed everything he needs (Apache, PHP, Mysql, Curl, Git, INTL and Composer). So far, so good, until I tried to…
-
0
votes1
answer67
viewsRelationship belongsTo
I wonder if it’s possible to do this kind of relationship in the cakephp model, if it’s possible, show me how, because I’m not getting it. Way I need to: public $belongsTo = array( Status =>…
cakephpasked 7 years, 11 months ago Marcos Henzel 797 -
0
votes1
answer407
viewsHow to call an ACTION from a specific CONTROLLER via a Button?
Using the following code: $this->Html->link( 'Meus Dados', array( 'controller' => 'Groups', 'action' => 'index' ) ); The HTML link is created normally, but if I want to put a BUTTON in…
cakephpasked 7 years, 11 months ago Marcos Henzel 797 -
0
votes1
answer420
viewsDatabase error, not null Violation, I am passing all values, where am I missing?
After completing the form and submitting, returns the following array: array( 'User' => array( 'password' => '*****', 'nome' => 'Engenharia', 'username' => '[email protected]',…
cakephpasked 7 years, 11 months ago Marcos Henzel 797 -
0
votes1
answer348
viewsFilter when selecting a checkbox
I need to make a filter where certain data is shown when selected some checkbox(s). For example: The checkbox has been marked "Aguardando embarque" and "Recebido", then you should display a list in…
cakephpasked 7 years, 11 months ago Marcos Henzel 797 -
0
votes2
answers127
viewsMake checkbox selected as database data!
According to the code below, I need to make sure that when loading the page, a table is loaded with checkbox marked, according to database data, for example: Destino…
cakephpasked 7 years, 10 months ago Marcos Henzel 797 -
0
votes1
answer103
viewsCakephp: Problems with routing and paging
I have a problem with the routes of CakePHP. I have the following URL: http://www.nomedosite.com.br/Produtos/index/61/789/ And it works normally. The problem is when I go to the second page:…
-
0
votes1
answer39
viewsA Model with 2 relationships but only 1 appears in the view
I have a model called doctor that belongs , to a city , and belongs to a specialty code : App::uses('AppModel', 'Model'); class Medico extends AppModel { public $belongsTo = array( 'Cidade' =>…
-
0
votes1
answer191
viewsQuery between two different postgresql cakephp databases
I have two separate databases customers and tickets. Where on the table cliente_tickets of the database customers a configuration is stored from which I need to access certain values in the database…
-
0
votes1
answer302
viewsClass 'Simplexmlelement' not found
As debug of cakephp in the Snippet down below: p.error { font-family: Monaco, Consolas, Courier, monospace; font-size: 140%; padding: 0.8em; margin: 1em 0; } .success, .message, .cake-error,…
-
0
votes0
answers185
viewsHow to recover the array of a post sent on Android to a php?
Android code: String caminho = "http://10.0.2.2/system/pages/login"; HttpURLConnection conn = null; BufferedReader reader = null; try{ URL urlConection = new URL(caminho); conn = (HttpURLConnection)…
-
0
votes0
answers53
viewsError requesting Cakephp internal pages?
I got a problem with mine CakePHP, I’m completely new to this framework and my erro is as follows: 2017-05-01 10:09:45 Error: [MissingControllerException] Controller class PagesController could not…
-
0
votes1
answer296
viewsSave cakephp associations 3
I am trying to save associated data in Cakephp 3, in the database I have two tables tabela entidades(id, nome_principal) and enderecos(id, entidade_id, cidade) In EntidadesTable i performed the…
-
0
votes1
answer53
viewsContrutor de Queries
I am learning about cakephp and would like a help. I have to do the sum of a column in my table (Postgres use). I’m trying to use the sum() function of the cake itself. My controller use…
-
0
votes0
answers22
viewsError using span in Cakephp
As attached image I can’t use span when I step to the Cake pattern. Can anyone help me, pfv. <div class='col-md-12'> <div class="input-group" > <!-- Span Bootstrap --> <span…
-
0
votes1
answer160
viewsCalling Component method on all controllers in Cakephp 3
I’d like to know how to call a method from a Component I created in Cakephp 3 on all controllers, as well as the Auth that checks whether the user is logged in or not on all pages (controllers). But…
-
0
votes3
answers805
viewsDelete records without updating page
I’m trying to delete records without having to refresh the page, but I’m not succeeding, the records erase but the table only updates if I give an F5, I’m trying to do this via ajax but it’s not…
-
0
votes1
answer69
viewsView images in the database with a separate cakephp file
I am using phpcake as an administrator of a photo gallery, the images are saved inside the webroot/img/galleries/ folder for each category a folder is created following a numbering. Up to there…
-
0
votes1
answer56
viewsOrdering paginate in Cakephp
I’ve never heard of Cakephp, I’m having a little trouble adjusting a purchased script where the developer doesn’t support it. This code is responsible for listing some records of images saved in the…
-
0
votes0
answers101
viewsValidate data and generate temporary password - cakephp
Good morning, I need to create a function that validates the client fields and compares to check if they are correct if they are, generate a temporary password. Follow my code below. function…
-
0
votes2
answers134
viewsHow to break a line within a link in Cakephp
I know it’s not right but I have a situation that I needed to do a line break within the link as attached image. I would like to work with the standard Cake but I had to do the line break by HTML.…
-
0
votes1
answer55
viewsMake multiple sql queries in a single query
Hello. I want to do a search for expenses entered in the expenses table. I want to do in the same query: add the expenses found according to the search parameters, count how many expenses were also…
cakephpasked 6 years, 7 months ago André Nascimento 1,258 -
0
votes0
answers130
viewsHow to work with plugins in Cakephp 3.6 or 3.6.1
How to work with plugins in Cakephp 3.6 or 3.6.1. Until version 3.5.13 I worked without problem, installed via Poser and loaded with bin/cake plugin load Name But in version 3.6 that was quite…
-
0
votes1
answer109
viewsCakephp 3.6 sending deprecated message (Accessing data as a Property will be Removed in 4.0.0.)
I have some code in Php using Cakephp 3.6 that keeps sending the following alert: Deprecated (16384): Accessing `data` as a property will be removed in 4.0.0. Use request->getData() instead. -…
-
0
votes1
answer131
viewsForeach with the mPDF library
Hello! I’ve got a boring problem I can’t seem to solve. I need to include a foreach in my report using the mPDF library, but I couldn’t find a way to do this in the middle of the HTML code I had…