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
-
1
votes2
answers292
viewsCakephp: Paging with manual query
The The Cakephp Manual suggests a change in default pagination for custom queries cases and in some cases my project has worked perfectly. But I have a situation where I have several custom queries…
-
1
votes0
answers31
viewsphpThumb() with Cakephp + error
Opposition, I’m having trouble loading the images where they go through the phpThumb() function, returning the error as per the image. Can someone give me a help? Local is working... Server with PHP…
-
1
votes1
answer41
viewsGoogle Adsense with Cakephp?
I’m trying to put an Adsense banner on Cakephp and I’m not getting it, the banner just doesn’t show up. How to do this ? footer.ctp <footer> <?php echo $this->fetch('script');?>…
-
1
votes0
answers169
viewsCake PHP - Form in the view index.ctp
I got the views: index.ctp, add.ctp, edit.ctp. Generated via modified Bake and everything, now what I need is in the view index, when you click ADD NEW or EDIT, instead of going to the respective…
-
1
votes1
answer81
viewsHow do I know the current connection the system is using in Cakephp 3.0?
Hello, I am working with two types of connections in databases with different settings. I want to know how I can get the current connection that the page is running dynamically. Currently I use…
-
1
votes0
answers20
viewsisUnique valitadion not working cakephp 2x
In my template, I created a valitaion for my email field, where if you have another email it shows that it is not possible to register, but this validation is not working. public $validate = array(…
-
1
votes0
answers67
viewsForeach inside if Cakephp
I have an A table that stores an item, and in this table, I have a related B that may have several items aggregated to an item in table A. Follow the if code: if…
-
1
votes1
answer105
viewsSelect Betweeen in data Cakephp
I’m trying to select records in a date range. $mesAtual = $this->requestAction(array('controller' => 'compras', 'action' => 'comprasMes'), array('condicoes' => array('Compra.status'…
-
1
votes0
answers491
viewsCakephp Does Not Load Css, Javascript, and Images
I have Cakephp in version 1.3.15 installed on a Centos server and the same project that works on the Internet, the local server only loads text and nothing else. As I enable developer mode, if there…
-
1
votes3
answers301
viewsSort query with cakephp paginate 3.0
$this->paginate = [ 'contain' => ['Unidades'], 'fields' =>['PontoDeColetas.id','PontoDeColetas.nome','PontoDeColetas.status','Unidades.id','Unidades.nome'], 'order' => ['Unidades.nome'…
-
1
votes1
answer134
viewsIs Cakephp 1.3.15 compatible with Php 5.6?
I have a project in Cakephp that is in version 1.3.15 and the manual says it is compatible with PHP 4 and 5. The hosting server is PHP 5.3.3. I wonder if it is really compatible with PHP 5.6.
-
1
votes1
answer42
viewsDelete WHERE clause if passed Zero or Cakephp 3.0
I’m working with the CakePHP 3.0 and created a query for his ORM, this query is working perfectly but now I need that if a certain parameter is 0 or nothingness is passed to the class method where…
-
1
votes1
answer227
viewsEdit formatting parameters passed by Cakephp URL 3
I have a unique field form, a input type="text", when the form is submitted to URL is as follows: http://localhost:8765/products/search?search=notebook I would like it to be as follows when…
-
1
votes1
answer136
viewsChange Admin access URL
Guys, here’s the deal: I create several sites and systems, and most of them have an administrative area. I do until then in the basics of being "urldosite.com.br/admin". Now, for safety’s sake as…
-
1
votes1
answer46
viewsQuery does not return all record data
The following query returns the correct record, but missing items on its return. $nota = $this->Nota->find('first', [ 'conditions' => ['id' => $numero, 'serie' => $serie ] ]); For…
-
1
votes1
answer137
viewsInsert into a different model table in Cakephp 2.x
I’m making a website with budget cart, with the CakePHP 2.x. I created a statistical table, I made the model of it all right but I will do an insertion in it, only when I enter the detail of some…
-
1
votes1
answer371
viewsfpdf with cakephp
I am using the library in fpdp cakephp, created a private method in my controller by mounting a basic pdf and then called this method in an action but it does not generate pdf.. private method:…
cakephpasked 9 years, 7 months ago Michel Henriq 647 -
1
votes1
answer167
viewsHow to use 2 or multiple connections in Cakephp 3.x?
I’m making a system where it takes information from 2 different databases, how can I take the data and differentiate it into the controller and view of Cakephp 3.x? Thanks for the help.
-
1
votes1
answer59
viewsPrint message on next page
How do I print a message when opening a page, for example: I’m on the page Cliente/View and when redirected to the page Nfe/index, I want to print a message with instructions on what should be done,…
cakephpasked 8 years, 1 month ago Marcos Henzel 797 -
1
votes1
answer121
viewsI’m unable to update a field in Cakephp with $this->Model->saveField()
I’m unable to update a certain field in Cakephp. When the $this->OrdemServico->saveField(), he simply does not perform. Code: class OrdemServico extends AppModel { public $name =…
-
1
votes2
answers950
viewsHow to ignore accentuation in a database search?
I need to conduct a city search. In the database is registered for example, São Paulo, Viamão, Curitiba, but if the user tries to search the city of São Paulo for example by typing Sao Paulo…
-
1
votes1
answer70
viewsBake cannot find model and controller files
I am using cakephp version 2.9, to make it easier I decided to leave all applications with a single core. So far everything ok, but when using Bake to be faster it does not find the…
-
1
votes0
answers53
viewsWebsocket and Cakephp
How to integrate Websocket into a Cakephp 1.2 system that runs on an Apache server with a Postgresql database? I need to chat, and all conversations will be saved in this bank, separated by system…
-
1
votes1
answer223
viewsHow to insert a CDATA type node in the xml generated by Cake PHP
With the code below XML in the CakePHP, however I need some nodes, have another CDATA type node. Example: <![CDATA[ Buscape Teste ]]> But I don’t know which parameter I have to pass for him to…
-
1
votes1
answer34
viewsYou doubt conditions in cakephp?
I’m trying to make a conditions in a find. I have 2 tables: tipopessoas and pessoas, on the table pessoas I have a foreign key for table tipopessoas. I want my find to bring the result only to two…
-
1
votes0
answers61
viewsRecognize date text in Brazilian format
Does anyone know any way to recognize text of Brazilian dates like, today, tomorrow, 30/04... on PHP using the function strtotime or in the Cakephp using CakeTime. I’m trying to get the same result…
-
1
votes1
answer41
viewsSave int, but display text
I’m studying Cake and I have a question, have some way to display a list, but save a number in the comic? For example, permission levels: 0 - admin 1 - vendas 2 - Edição 3 - Financeiro In all views…
-
1
votes1
answer229
viewsHow to make two relationships for the same table?
I have a table called advertencias, in this table I have 2 Foreign key for the same table called pessoas in this table person I have two types of person Student and Teacher, then in the table…
-
1
votes0
answers38
viewsfailed to update Cakephp
I’m trying to edit a record in Cakephp 3 and instead of editing the system, it’s inserting a new record. Staticscontroller.php public function editar($ID){ $estatisticasTable =…
-
1
votes1
answer494
viewsCreating/Viewing HTML report
Guys, I have a problem and I couldn’t think of a solution ... People who have used iReport know that it has to do grouping very easily in it... The problem is that I am now reporting in HTML ( in…
-
1
votes0
answers33
viewsAccess external webservice with cakephp
I’m trying to make requests on external Webservices with Cake’s Httpsocket, in the documentation you have this example $HttpSocket = new HttpSocket(); // string query $results =…
-
1
votes1
answer249
viewsUpdate Cakephp Version to Newer
I have a project in hand with the version of Cakephp 2.2.3, I would like to upgrade to a newer version of the framework, because if I’m not mistaken, it’s already in version 3.5. I’ve seen some…
-
1
votes1
answer163
viewsTransform 2 php array into a single array
I have 2 Arrays: "val" => { "0": "2" "1": "4" "2": "6" "3": null "4": null } "p" => { "0": "4" "1": "5" "2": "7" "3": "8" "4": "9" } Before that I want to take the elements of array val which…
-
1
votes1
answer32
viewsdisable select in cakephp
I have 2 selects, and want to make sure that when one of the select is with a different empty option, the other select enter disable. Follows my code: <script type="text/javascript"> function…
-
1
votes1
answer22
viewsHow to start Cakephp3.x
I’m getting agr with the cakephp, I followed the bookmarker tutorial, but is there any material with a simple didactic, explaining the concepts, which are used in cake? I see youtuber using the…
-
1
votes2
answers55
viewsHow to get a value from an array property?
A VÁRIAVEL ARMAZENZA: $parcelas = DB::select("SELECT parcela_number FROM parcelas WHERE 3000 BETWEEN valor_min AND valor_max"); VAR_DUMP: array(1) { [0]=> object(stdClass)#144 (1) {…
-
1
votes1
answer105
viewsupdate mysql attribute according to a day (12/12/2019) cakephp, mysql
I have the following problem: If a client does not pay a certain portion, he would like the system (mysql+cakephp) to place the client with the debtor status. would have some way to automate this,…
-
1
votes1
answer431
viewsUsing Jquery Datatable with Cakephp?
I’m trying to use Jquery Datatable server-side with Cakephp but I’m not getting it. I am looking for some example for this but not yet found. When running Datatable Jquery returns an error: Uncaught…
-
1
votes1
answer87
viewsLink to cakephp within jquery?
How to create a link using Cakephp conventions within Jquery ? I’m trying like this but I still can’t make it work. $(document).ready(function() { $('#dataTables-example').DataTable({ "processing":…
-
1
votes2
answers306
viewsHow to set flash in CAKEPHP view?
In the method in my controller I select the flash, according to the condition. if ($this->Auth->user()) { //redireciona apos o login; echo $this->Session->setFlash("Bem-vindo"); } How…
cakephpasked 9 years, 5 months ago André Nascimento 1,258 -
1
votes1
answer491
viewsRule in model to format date
I have two rules in two camps. In the data_expense field, I want to take the format d/m/a and move on to a-m-d. Turns out when you save it on the bench, it’s like 0000-00-00. I don’t know how to…
cakephpasked 9 years, 4 months ago André Nascimento 1,258 -
1
votes0
answers117
viewsCakephp makes "action" and "template" more concise
I have some questions about how I can improve this "action" (method) in my "controller": Question discussed in: Post functional code in stackoverflow for refactoring? Man template has a navigation…
-
1
votes1
answer74
viewsRedirect Loop Cakephp
I’m maintaining a cakephp system but trying to log in to Brower returns the following error. This webpage has a loop redirect I searched the stack em ingles and found a "solution" that told me to…
-
1
votes0
answers127
viewsPopular a select with php result using jQuery and cakephp
Hello, I’m trying to popular a select with the options that are returned, according to what the user selects in a particular select. The problem is that I’m a layman with jquery and I don’t know if…
-
1
votes2
answers68
viewscallback afterFind
Hello, I still can’t use the afterFind, even following some posts on the net. Help me with the controller and model, please. I use beforeSave, but I can’t use afterFind. I’ve already put Return…
cakephpasked 9 years, 2 months ago André Nascimento 1,258 -
1
votes2
answers52
viewsQuery brings data ignoring $conditions
I’m making a query and the cake is bringing all the data ignoring $conditions. I want to search by date, but when I put a date that does not exist in any record, it still brings all the data. public…
cakephpasked 9 years, 2 months ago André Nascimento 1,258 -
1
votes2
answers63
viewsDate formatting is changing its parameters
I’m using callback beforeSave to format the date of d/m/Y for Y-m-d. The date is being saved as Y-d-m instead of Y-m-d. Syntactically the code is right. The date is in the table as date. function…
-
1
votes0
answers84
viewsAmadeus session error with cakephp
First of all, I want to make it clear that I know the documentation is private. I have the documentation in hand, I followed everything right, but the Amadeus keeps giving this error: 17|Session|No…
-
1
votes2
answers133
viewsCakephp - 1~n ratio
Good evening, I’m having a hard time on Cakephp 3 and the problem is this:: Cannot Insert Row, some of the Primary key values are Missing. Got (, ), expecting (idstorie, users_iduser) The system…
-
1
votes1
answer320
viewsHow to fix error Impossible to generate condition with Empty list of values for field (Tags.title)
I’m playing with cakephp 3 by doing the Cookbook bookmarker tutorial. I am implementing the action in the bookmarks/tags controller, but when trying to access the error of the question title:…