cakephp

Is cakePHP preferable for a large scale web application?

Hi, I am a good PHP developer and wanted to develop a large scale web application in PHP. I was thinking about using CakePHP framework. Is cakePHP good for large scale web application? Should I start learning and using it? Is cakePHP worth investing time and money or should I go with core PHP or some other framework? I heard that it is...

cakephp form/date helpers

I have 3 dropdwons for day month and year. I was combining them till recently to save date_of_inspection in the db in mysql format. I was using the Day, month and year cakephp form helpers.This is what i was doing $this->data['Cabinet']['date_of_inspection'] = $this->data['Cabinet']['date_of_inspection']['year'].'-'. $this->dat...

CakePHP error 'page not found' error - how to avoid

I need some background information about CakePHP, and how it works... let's say that i have method (function) defined in CakePHP's controller, ie. deleteItem, like function deleteItem( $id = null ) { $this->PublicationNumeration->delete( $id, true ); } The CMS I developed works ok, proper record is deleted ($id), and it works f...

Sanitise data in cakephp

I want to sanitize data in cakephp but i am facing a problem. i have a form with a date field . When i tried to sanities all the data the date looses it's mysql format and is stored in the db as a rubbish data(1970-01-01) but if i remove the sanitize it works fine i tried the following function beforeSave() { $this->data...

CakePHP getting data from multiple models

In my CakePHP application I have a model called 'Customer' which describes (unsurprisingly) an individual customer. I then have a 'Sale' model about a sale. (One customer per sale, many sales per customer). Each sale then has a 'car_id' (which maps to the 'Car' model) and an 'engine_id' (maps to 'Engine model'). Currently when I get the ...

Getting t_string error after ::

Ok, sorry for this upcoming rookie question.. I was looking for a good user management plugin for cake, and i was recommended Authsome (if someone knows anything better>> plz recommend). Anyway, i'm trying to set it up using the git's readme (very simple) but im running into a problem: t_string error. Code: Parse error: syntax error, ...

CakePHP help with read()

I am following the blog tutorial and modifying it to fit my site's needs. I am having a little trouble with my view function. function view($id = null) { $this->Article->articleid = $id; $this->set('article', $this->Article->read()); } This line does not work, I get this error: Warning (512): SQL Error:...

CakePHP how to use static values (categories)

I would like to have categories, and rankings for my content and users respectively, and I am not sure how to go about implementing this using CakePHP conventions? Do I need to create a model? ...

Cakephp ajax pagination issue

I am trying to implement the cakephp ajax pagination and it's working fine expect for one problem. the layout is repeating again but only once. What i mean is that first time i click on the pagination link(next/prev/no) the layout repeats again but if i click any pagination link the layout doesn't. I have followed the tutorial given on...

CakePHP: accessing data from query in view

Hi, I have a hasMany relationship set up. User hasMany Projects. In my users controller in the profile view I can see the projects being returned for that user in the SQL dump. I want to display each project in my profile view for that user. So I have set up a association between user and projects. User hasMany projects. I have created...

How to display results from a HABTM relationship in a view?

I have a HABTM relationship between a books table and an authors table, joined with an authors_books table. However, I can't find a solution to display the fields firstname, lastname and fullname in my view. book-model: class Book extends AppModel { var $name = 'Book'; var $hasAndBelongsToMany = array( 'Author' => array( 'c...

Logging from Vendor classes in CakePHP

I have a CakePHP application that uses a number of vendor classes, including one to handle email. We're having some issues with emails not arriving, so we want to add a log message every time an email gets sent. The obvious place to do that is in the send function of the email class, but $this->log doesn't work, since the vendor object...

cake php router

while I run the cake php application? Fatal error: Class 'Router' not found in C:\wamp\www\tickerping\app\config\routes.php on line 34 how to solve this ...

php & mysql sum/total top ten problem.

I am trying to return the top ten entities that are associated with articles after doing a search on the articles. Lets say I have the following set up: CREATE TABLE IF NOT EXISTS `articles` ( `id` char(36) NOT NULL, `html_content` text NOT NULL, `featured` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), FULLTEXT KEY `ht...

the curious case of backslashes in uploaded file pathnames on xampp + cake

XAMPP + Cake installation on Windows 7 causes the curious problem of introducing backslashes in pathnames of uploaded files. ...

Using core validation within custom validation on CakePHP Forms/Models?

Using CakePHP 1.3 I understand the example at http://book.cakephp.org/complete/1143/Data-Validation#Adding-your-own-Validation-Methods-1181 on how to add my own validation methods, but maybe I'm missing something. I only want to validate that Field_B is 'numeric' (a core validation) if Field_A (a select/option) is equal to a certain...

What is the best way to do routing from 2+ models in CakePHP?

I have been searching for a couple hours for a way to accomplish this task (which I know is fairly elementary), but I can't find any documentation... I have three models - reviews, users, and books - and I'm designing the review controller and add action for that controller. I already have the user_id pulled from the session and used to...

cakephp registration form not verifying fields

My registration form is not checking all the fields and is calling login and saying that I registered successfully. Also, if both passwords are blank, it still "registers" heres my User model <?php class User extends AppModel { var $name = 'User'; var $validate = array( 'username' => array( 'rule' => 'notEm...

CakePHP Session without Cookies

I want to make an application that doesn't need cookies but still has Sessions. Therefor I create the SessionID and take it in the URL with me. My problem now is that the HTML helper doesn't recognize this and all links that are outputted are without the session id. Does CakePHP have to be told to do that or isn't there any mechanism f...

TinyMCE and CakePHP

I am using the cakephp tinymce helper. I know I can change the themes from simple and advanced, etc. I'm wondering if it's possible to go further than that and explicitly set the different font, etc the user can choose? So if I only wanted the user to be able to use a paragraph tag and the pre tag? ...