CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It uses commonly known design patterns like MVC and ORM within the convention over configuration paradigm.
1
vote
2answers
46 views
Can I make this admin method in CakePHP more streamlined?
I have a VenuesController and an EventsController. My venues controller has an admin_add method that, well, allows an administrator to add a venue to the database. It looks like this:
public function ...
2
votes
1answer
100 views
Need your opinions on my database normalization attempt [closed]
I'm working on a project with CakePHP where it will allow users to log their drug use. Be it alcohol, caffeine, or whatever else. When people add a log, they select the substance from a drop down, ...
1
vote
1answer
79 views
CakePHP Ticket Component
I have the following code that allows easy creation, pulling, and deletion of Tickets in a CakePHP application.
App::uses('Component', 'Controller');
App::uses('Ticket', 'Model');
...
1
vote
2answers
70 views
Please tell me if it is a good controller or not. Would really appreciate
<?php
session_start();
include_once("model/Model.php");
class Controller {
public $model;
public function __construct()
{
$this->model = new Model();
}
public ...
1
vote
1answer
64 views
How to optimize the pagination query?
This is completely optimization question, I have a pagination query like that
$this->paginate = array(
'fields' => array(
'DISTINCT Contact.contact_id',
...
1
vote
1answer
191 views
CakePHP return url validator
I have the following snippet of code that redirects a user to a specific page on successful login to the application.
if(isset($this->params['url']['next'])) {
$url = ...
1
vote
0answers
193 views
CakePHP Best strategy for getting HABTM data in multiple ways within the same tool
School HABTM AthleticDirector
I am building a tool for assigning athletic directors (ADs) to schools. The tool has a school menu/filter which, when selected, shows a list of ADs already assigned to ...
1
vote
1answer
189 views
Is there a better way to loop through records and call an api?
I have a CakePHP function here that gets info for a twitter screen_name from the twitter api and writes it to a mysql db. I'm just looking for feedback about other ways to accomplish this that might ...
3
votes
1answer
186 views
CakePHP 2.x Custom PagesController & Routing
I want to direct all requests that haven't got a valid controller action to my custom page controller.
I.e. I want /pages/new & /users/login etc to work correctly, but a request for /foo or ...
0
votes
2answers
76 views
methods in the class so close in what they do
I have this class that has these two methods that are so closely related to the each other. I do not want to pass the flags so I kept them separate. I was wondering if there is a way to rewrite it so ...
1
vote
2answers
403 views
Is this the right db design for the most flexible and modular CMS with user management in CakePHP?
I would like to ask you guys if you could review my database design:
I think it is quite self-explanatory, but to be absolutely clear:
My goal is to make an application which has a super flexible ...
1
vote
1answer
2k views
new to cakephp - saving data into table [closed]
I've been trying to learn cakephp recently but I'm struggling to find any tutorials that deal with storing data into a table after it's been modified.
I thought a good first experiment would be to ...
1
vote
3answers
307 views
Using CakePHP models/controllers properly
I'd like to know if I'm doing this properly. Basically, I have 3 models: Student, Course, StudentCourse. I'm running into problems when I'm trying to sign a student up for a course (I've removed a lot ...