cakephp

.htaccess rules for "Coming Soon" page on CakePHP site

I've been stuck for a while now on how to create a "Coming Soon" page for my CakePHP site. I need to keep the webroot directory protected via .htpasswd so only authorised users can access the site whilst it's being built. However, regular visitors should be shown the "Coming Soon" page when they visit thesiteurl.com or thesiteurl.com/ind...

Get only declared methods of a class in PHP

Hello I need to get only the methods declared in a class, and not the inherited methods. I need this for cakePHP. I am getting all the controllers, loading them and retrieving the methods from those controllers. But not only are the declared methods coming, but also the inherited ones. Is there any method to get only declared methods. ...

External linking and cakephp's routing enginge (multilangual)

Hi! I recently build a tiny routing 'extension', that calls the routes from a MySQL table (structure downwards). I think it's worth to be mentioned, that this page runs in multiple languages (German and Englisch). So - relying on the cookie, that's currently set in the client's browser - the corresponding routings get connected. The pr...

How to get intro record from each group

I have a following table id group name 1 2 dodo 2 1 sdf 3 2 sd 4 3 dfs 5 3 fda .... and i want to get intro record from each group like following id group name ... 1 sdf 2 dodo 3 dfs ... ...

How to user "and" condition in cakephp model?

Hello, I am using this to validate a form field $valid = $this->isUnique(array($fieldName1 => $data, $fieldName2 => 'Y')); executing this the query is coming like this: SELECT COUNT(*) AS count FROM users AS User WHERE ((User.emailid = ('[email protected]')) OR (User.isdeleted = 'Y')) I just need to change that "OR" to "AND". Pl...

RPX token URL problem

Hi there, I am using RPX in my CakePHP project. I have set the toke url like this: http://www.mysite.com/users/login Here is my login action code. function login() { $this->Ssl->force(); $this->layout = 'colorbox'; $this->pageTitle = "User Login"; } I have used SSL with the login form. Look above code( $this->Ssl...

Send email when any error occurs in CakePHP

Hi, I am using CakePHP in PHP development. I have set my debug mode to 0 in core.php file. Configure::write('debug', 1); This setting will not show any error on site. So the user/developer will not be able to see errors. Thant's why I want to make something that will send me an email with error title and error code like Warning messa...

Request Entity Too Large PHP

Hi, In one of my CakePHP site, I got this error. Request Entity Too Large I don't know what is the problem. I think the data that I am posting through form is too large. I searched this in search engine and got that I will have to increase post_max_size. Be default I think it is set to 8M. But don't know how to increase post_max_size...

saveAll ignore previous set statements CakePHP

Hi, I have an Account and a User Model with a one to one relationship, I'm trying to use saveAll to save the data to the db: $this->Account->set(array( 'uid' => uniqid(),'date_registration' => date('Y-m-d'),'state' => 1)); if ($this->Account->saveAll($this->data) ) { However, saveAll seems to be saving only the data in $this-date a...

cakePHP + extjs row editor and REST

I've implemented REST routing in cakePHP to properly route REST style requests to the proper methods in my controller. This is what I've added to my routes.php Router::mapResources(array('object_fields')); This properly routes the REST requests to my index/add/edit/delete methods inside my controller. In my EXTJS grid I am using the...

How can I validate and "re-show" dynamically created form elements in CakePHP 1.3?

Using CakePHP 1.3. I've created a form with a primary model that 'hasMany' secondary models. However, the fields for the secondary models are created by Javascript ("add one" buttons). While they adhere to the CakePHP naming conventions, I'm wondering: How do I hook up any kind of server-side, CakePHP validation to these fields, and...

What is a ABSTRACT CLASS and INTERFACE and when would you use them in PHP?

What is a abstract class and interface in PHP and when would you use them? A layman answer with an example would be great to aid my understanding. Thank you in advance ;-) ...

Why I can't change the data of another model in CakePHP

Hi, I have a one-to-one relation between an Account and a User table, I'm trying to do all the pre-processing in the beforeSave of the account model, but it seems like i can only change the values of $this->data['Account'][...] and not $this->data['User'][...], why is so? function beforeSave() { // Check if this is a create or updat...

Cakephp Pagination issue

Hi i am facing a issue with the pagination helper. I am sorting the records based on user criteria like date range etc via drop downs . And it works fine. It paginates properly. But when i click on page 2, it shows page 2 of all results an not the sorted results. How can i fix it. The fields are sorted via POST and not GET and don't want...

find condition with imported Model

Hi, In my AppController I do: App::import('Model', 'Season'); $season = new Season(); $aktuelleSaison = $season->field('id', array('Season.is_aktuell'=> 1 )); $teams = $season->Team->find('list', array('conditions', array('Team.season_id' => 11))); debug($teams); Of course the season hasMany Team. The Problem is: The fired Qu...

Need help with hasAndBelongsToMany (HABTM) Cakephp find

Hello, I am trying to query a hasAndBelongsToMany relationship in Cakephp 1.3, but it looks like the SQL query being run is not doing a Join on the many to many table. I have a users table, projects table, and users_projects table. I want to get a list of all projects a user is associated with in a separate Allocations controller. I ha...

CakePHP created and modified columns for MS SQL

It appears that my automatic CakePHP table columns - created and modified - are causing an error when I migrated to Microsoft SQL Server 2005. I found this old ticket, but nothing that seemed to resolve the issue. Here is the error: Warning (512): SQL Error: Conversion failed when converting datetime from character string. [CORE/cake/l...

jQuery UI autocomplete + CakePHP

I'm setting up jQuery UI autocomplete on a CakePHP site, and feel like I'm missing something really obvious, but it's almost working... So the simple jQuery code is: $(function() { $("#SearchQuery").autocomplete({ source: "<?= $session->base ?>/search/complete", minLength: 2 }); }); This connects to my search ...

CakePHP Problem disabling debug in Controller action

Can someone help me work out just what I happening here. I have an ajax function on my controller, when it returns the json it flags up some undefined variable notices even though I have Configure::write('debug', 0) at the top of the function. Outputting Configure::read("debug") in the function shows zero correctly. If I change the de...

cakephp-mssql integration:how does it works

I am newbie in cakephp world when i am trying to configure cakephp with ms-sql, I am not able to connect to database. php-mssql configuration is working fine for me( though for that i uses ADODB connection ) . But nothing worked for cakephp. I searched a lot on google but none of the ways are working for me. Thanks, Ankur ...