Questions tagged as 'cakephp'

1
answer

CakePHP 3 - Inner Join

How do I make an inner join to relate an article table to a favorite article table using cakephp 3. favorites table: CREATE TABLE IF NOT EXISTS 'favorites' ( 'id' int(11) NOT NULL, 'user_id' int(11) NOT NULL, 'article_id' int(11) NOT NU...
asked by 09.05.2015 / 18:51
1
answer

How to access a variable from a function in another function

Let's say I have the function public function testeX(){ $x = 1; $this->set('x', $x); } And I want to access the value of x in another function that has a view testY.ctp public function testeY(){ // Esta é minha view //Com...
asked by 12.05.2015 / 15:11
1
answer

Table Relationships with CakePHP

I have two tables: artigos (id, categoria_id, titulo, texto, criacao) and categorias (id, nome) . And they have a relationship ( artigos.categoria_id => categorias.id ). And I'm doing CRUD, but I would like to know how to c...
asked by 08.01.2015 / 13:00
2
answers

CAKEPHP: conditions with AND

I have a question when I search. The conditions item in my current query looks like this: 'conditions'=>array( 'Produto.publicado'=>1, 'Produto.titulo LIKE'=>"%$kw%", 'TagsProduto.tag_id'=>$tags ), However, $ tags...
asked by 09.03.2015 / 18:20
2
answers

Error generating PDF in CakePHP via FPDF

I am rewriting a legacy system from the company I work in (using CakePHP for this) and it generates some PDF reports using FPDF. However, in CakePHP I can not generate any PDF. Follow the code Action function pdf ($id = null) { App::...
asked by 23.01.2015 / 17:30
1
answer

Given handle of a specific field cakephp

I'm starting now with CakePHP, and I'd like to know how to get the value of a specific field. For example, I have the name and email fields. How do I get the value of the field name? PS: I know you have the method $this->data , bu...
asked by 09.12.2014 / 21:43
3
answers

Element cakephp

Hello, I really need a help, I have a view that has an element, but this view is used for all the pages of my site, but in some pages I do not need the element, but I need to use the view, can you "block" that element of those pages?     
asked by 12.03.2015 / 14:54
2
answers

Generate 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 from the database table?     
asked by 19.01.2015 / 14:40
1
answer

Relate tables with CakePHP

There are two tables in the database, posts and comments and I want to link them together. I think I have to create a foreign key in the comments table in a field that stores the title or table id posts , so I know which post that comm...
asked by 07.12.2014 / 15:29
1
answer

How do I create external link using cakePHP?

A link of the type below is used to link to a page of our own system: <?php echo $this->Html->link('Listar todas as tarefas', array('action'=>'index')); ?> What if I want to link to YouTube for example or another site?     
asked by 05.12.2014 / 18:39