Most voted "cakephp-2" questions
Cakephp Version 2 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.
Learn more…92 questions
Sort by count of
-
1
votes2
answers108
viewsChanging values of a table row by row
I have a little problem. I have a table with stock values, and I need to change these values as follows. The customer will insert a quantity that he wishes to manufacture of a certain product, and…
-
0
votes1
answer263
viewsConfigure Cake Bake for Cake Version 2.x
I have a Cake 2.3 Library on my Ubuntu 13.10 configured and running normally. When I try to use cake Bake, it automatically takes over Cake 1.3 Welcome to CakePHP v1.3.14 Console Question: How do I…
-
0
votes1
answer1055
viewsSave data to the database using Form in Cakephp
I’m trying to make a tool for the administrator, the site I’m building, that will allow you to upload images to a folder on the server, so that they appear posthumously in the gallery. The image…
-
0
votes1
answer62
viewsWhy is the escape parameter not recognized in the Cakephp Htmlhelper?
When trying to create an image as a link in cakephp using Htmlhelper, the HTML code is generated as String in the browser <?php echo $this -> html -> link( 'Visualizar' .$this -> html…
-
0
votes1
answer142
viewsProblems Relating Models in Cakephp
This and the Model User class User extends AppModel { public $name = 'User'; public $useTable = 'users'; public $displayField = 'name'; public $belongsTo = array( 'Role' => array( 'className'…
-
0
votes1
answer1190
viewsDefault route controller/action and links to css/js do not work cakephp
After extracting cake 2.5.2 to the directory (Linux) /var/www/html/teste when accessing the url http://localhost/teste it loads the contents correctly from the controller pages and action display…
-
0
votes1
answer421
viewsHow to Download Files in Cakephp?
I have the path to a saved image in my bank. I would like to put a button in my view to download that image. How to do?
cakephp-2asked 10 years ago Devidy Oliviera 381 -
0
votes2
answers847
viewsGenerate PDF from filters in Cakephp
In a management page it is possible to filter by Company, User and between two dates. How to generate a PDF when the user clicks the button based on the filters used or then from the Database table?…
-
0
votes1
answer136
viewsConsole. My application works normally no longer I can use the Console
My application works normally more when I try to use the Console it gives the following error: PHP Warning: include(Cake/Console/Shelldispatcher.php): failed to open stream: No such file or…
-
0
votes2
answers80
viewsCAKEPHP: conditions with AND
I have a question when making a search. The item conditions in my current query is this way: 'conditions'=>array( 'Produto.publicado'=>1, 'Produto.titulo LIKE'=>"%$kw%",…
-
0
votes2
answers72
viewsContain or John, huh?
I have the following code: $contacts = $this->Contact->find('all', array( 'limit' => 20, 'contain' => array('Address', 'Phone' => array('fields' => 'Phone.phone' ), 'Campaign'),…
-
0
votes1
answer60
viewsHow to add an array with itself more data?
It’s the following guys. I have a for and inside it I have an array ($smses) that receives ($smses = $smses + 'my application’s data'). The problem is that this does not work, I would like to know…
-
0
votes0
answers230
viewsConverting Date To Milliseconds
I’d like some help converting this function to the Cakephp standard. She takes the date from datetimepiker and turns it into milliseconds, but I’ve searched a lot and I can’t find anything similar…
-
0
votes1
answer55
viewsStructure Cakephp
I’m starting a project on Cakephp 2.X and it has CMS + Website. I would like to know the best way (correct and usual) to structure the files, as I would not like to keep all the files together, that…
-
0
votes0
answers646
viewsField Completion with ZIP in Cakephp 2.x
I’m trying to auto-fill the fields in Cakephp from a zip code, I’m adapting the code found on this site: http://matheuspiscioneri.com.br/blog/preenchimento-automatico-do-endereco-a-partir-do-cep/ I…
-
0
votes1
answer194
viewsHow do I query if a record exists in cakephp 2.6?
I wonder if a record exists in cakephp 2.6 As everyone knows, cakephp has to use the id key, however this table is a key composed of 4 fields. I gave a read and tried to use beforeSave(),…
cakephp-2asked 8 years, 8 months ago Punisher07 35 -
0
votes1
answer69
viewsError searching the database with cakephp-2
I wonder what’s wrong with my consultation. I am debugging it, and is bringing all the results of the Registrohorario model and not just one result per user, ie the parts of "Fields", "group" and…
cakephp-2asked 9 years, 11 months ago Julyano Felipe 581 -
0
votes1
answer45
viewsRelation between table A and B returns error because it calls data from table C in Cakephp
I am 3 days banging head with a problem: I have some tables in the system and this error happens on the most unlikely screens. I’ll give you the latest example: 2015-03-13 16:37:51 Error:…
-
0
votes1
answer71
viewsHow to hide data in a table according to status
I have a code that searches the data in the database and prints on the screen a table. My table that appears on the user screen has the fields: Referência | Abertura |Status |Objeto Reference is an…
-
0
votes0
answers70
viewsCakephp 2.x if, Else
I have a project in Cakephp 2.x, with the following code: <?php echo $this->Form->create('Planos', array('url' => 'addPlanos')); foreach($ListarPlanos as $indice => $AdicionarPlanos):…
-
0
votes1
answer43
viewsSCRIPT to Convert and Save Addresses
I developed a script to convert a coordinate in a REST API with Cakephp $lat and $lng in formatted addresses. The script checks if the coordinate is saved in the bank, if negative it searches google…
-
0
votes1
answer849
viewsHow to get back data from a function via ajax?
I have an ajax in my view add that makes an asynchronous request in an action test in my controller, in this function I need to return the variable $balance to my view add, I would like to know how…
-
0
votes0
answers42
viewsPopulating select via the other select option
I have a system made in Cakephp. I have 3 selects in one view: One to list stocks; One to list the locations of the stock (A stock can have several locations); And one to list the products you have…
-
0
votes1
answer31
viewsHow to get the log record of the `Cakelog::write()`method?
I’m studying about the logs of cakephp and in my code I added the following line for all actions of INSERT, UPDATE and DELETE of my system of crud. Cakelog::write('debug', 'mensagem de exemplo de…
-
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
answer180
viewsSep::Sort Cakephp array
I need to sort an array in cakephp according to the order passed by parameter. The code that makes the ordering would be this: //Realizar a ordenação de acordo com o que receber do formulário no…
-
0
votes1
answer226
viewsHow do JOIN using find()?
I am trying to Join tables using cakephp find(). I have 3 tables, they are: users, pessoas e matriculas. On the table users i have a foreign key for table pessoas and in the table matriculas I have…
-
0
votes2
answers58
viewsFind birthday girls of the month
I would like to make a condition where only show the birthday of the month. My controller looked like this: public function index() { $ultimoDia = date("t", mktime(0,0,0,date('m'),'01',date('Y')));…
-
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
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
votes1
answer127
viewsMysql Relationships: Query Problem
I have the following scenario I need to get all the consulta_tipos with consulta_itens aligned and mark those that are in cliente_consulta_tipo and cliente_consulta_itens, also need to seek the…
-
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
answer452
viewsXDEBUG configuration in PHP.ini ( Cakephp, Appserv - Apache2.4, Netbeans)
My friends, good afternoon I’m new to the piece, I mean, in the PHP development area and I’m making the settings to debug an application in Cakephp 2.6. I followed all the XDEBUG documentation,…
-
0
votes0
answers24
viewsCakephp 2.5 model generates JOIN in column that does not exist
Good morning I’m using cakephp 2.5 and have a vehicle table and a vehicle address. There is no live column, but a JOIN is generated that uses the input to use the ve_id that was explicitly specified…
cakephp-2asked 7 years, 11 months ago Ângelo Rigo 163 -
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
votes0
answers120
viewsIonic 2 + Cakephp 2.X Rest
How to parse data in json next? I’ve tried using the promise and the observable. { "diaries": [ { "Diary": { "id": "1", "user_id": "1", "title": "T\u00edtulo da agenda", "description":…
-
0
votes2
answers47
viewsPass a constructor variable to another method
I am using PDO and I want a constructor method with the database connection but the connection variable is not accessible in another method class Stock{ public function __construct(){ $conn= new…
-
0
votes1
answer67
viewsReturn of consultation in descending order
With this code, how do I make the return of the query come in order decreasing? <?php session_start(); include_once "conexao.php"; ?> <!DOCTYPE html> <html lang="pt-br">…
-
0
votes2
answers44
viewsHow to Improve/Optimize this code?
I have the following code, and I would like to know if it has how to improve, and how to improve this code: $user = $_SESSION['nome_usuario']; $data = date('Y-m-d H:i:s'); $lote =…
-
-1
votes1
answer58
viewsPagescontroller Cakephp runs only the display action
I created the home.ctp in the briefcase /Views/Page/, and it is working, I also created the home method, however, when accessing /pages/home/, the only method accessed is the display, someone can…
-
-1
votes1
answer82
viewsEdit TXT File with cakephp
Guys if possible would like a help to edit a file .txt that is formatted with json_decode(). On the controller went like this: public function index() { $json_str =…
-
-2
votes1
answer716
viewsApache does not read subfolders or other files
Recently, I formatted my computer and installed Ubuntu 14.04 and as always, I changed the apache root Document to: /home/user/Workspace/web. Inside this folder I cloned a project of mine made in…