cakephp

jquery validation plugin and check unique field?

I am currently using jQuery validation plugin with cakephp in my new project. It's working perfectly untill I need to make unique check to email field through ajax to check with the database.. I didn't know how to make the plugin make a unique validation to email from db. thanx ...

CakePHP Bake with Cygwin on Windows 7

I've been working with CakePHP for a few weeks now and I really enjoy it. I skipped over the Bake Console figuring that I'd learn more if I wrote everything by hand. Now I'd like to actually use this tool so I setup an alias in my Cygwin profile but every time I type cake bake it just hangs. I can't even use task manager to exit out of t...

CakePHP: AppController to access model of derivated Controller

I want to implement shared "add" actions in the AppController. For this, I need to access the appropriate model of the derivated controller. How do I do this? ...

Slow server response time - CakePHP

I am using CakePHP 1.2 for building a website. The problem i am facing is when ever a page loads it takes a lot of time in "waiting for www.example.com". The server response time is very slow. First i thot it was my database queries, but they were executing in less than seconds time. Next i also contacted the server people. They told it ...

Understanding Smarty and MVC Frameworks

Hello there, I just created this thread to discuss with people who have adopted the smarty system, and how many time it took to you to understand it, because i just can't get the idea, instead of making every easier as everybody says i think it just make more complex to code. More than a problem with only smarty is with the whole MVC m...

Cakephp saveAll() Fatal error: Call to a member function getColumnType()

So I am creating a form builder. Users will login and then fillout the forms that Admins have created. I am using saveAll() in my "data_controller" "add" method. This works fine and and looks like this: //debug($this->data); prints the following //app/controllers/data_controller.php (line 21) Array ( [Datum] => Array ( ...

CakePHP Users, Groups, and data belonging to users

I am building a CakePHP app that requires admins, users, and merchants. Merchants will need to have a profile. Users will need to provide different info for their profile. I currently have a user model handling login with ACL enabled. That is all working fine. What I cannot wrap my head around is how do I handle having a different...

how to improve cakephp auth component to use user type?

i use auth componnet in my cakephp project I add type field into users Mysql table that enum type: admin, client i need auth component to redirect admin's to CP page, and client to their profile page and only can access one conttroller.. ofcourse without using ACL or any others related ...

CakePHP pages_controller always uses default layout

I have a static page that I want to serve so I made a .ctp in the /views/pages/ directory. The problem is that it's using the default layout which I do not want to use. I tried making my own pages_controller and passing the $layout var but that does not work. There has to be a way to tell a /pages/ to use another layout.ctp. No? ...

How to deal with Ajax Auth errors in CakePHP

I'm using the Auth component on my pages and I would like to show a login overlay when an Ajax action is called for which the user doesn't have permission. Example: User wants to edit a jeditable field, then when the users wants to change the value, he will first get a login/register overlay. My current way is to check in the action f...

Cakephp check to see if two values are in array.

I need to only allow members to write a review on a accommodation if they have stayed at the accommodation and there member_id matches the Auth->user('id'). On the accommodation/view I pass the BookingRequests data. which looks like this BookingRequest 0 member_id => 4 accepted => 1 1 member_id => 5 accepted => 0 ...

CakePHP: Need DB table for every controller?

Hello! I'm newbie to CakePHP but got strange error. I'm just testing it, how to implemetn many functions and got strange error. Created controller called 'about' and got following error: Error: Database table abouts for model About was not found. Does CakePHP require to have DB table for every single controller? PS... var $useTabl...

making the home page require Auth (CakePHP)

Hello, I just started to learn CakePHP and i'm trying to make the homepage (views\pages\home.ctp) only available to logged users, so if an unlogged users enter to the homepage they should be redirected to Users controller, where it prompts for user data, using Auth Component. Where I can set the "controller" for the homepage? please co...

Best solution for managing navigation (and marking currently active item) in CakePHP

So I have been looking around for a couple hours for a solid solution to handling site navigation in CakePHP. Over the course of a dozen projects, I have rigged together something that works for each one, but what I'm looking for is ideally a CakePHP plugin that handles the following: Navigation Model Component for handing off to the ...

cakephp Activation Email Sending slow

Hi all, I have a simple email sender for user account activation. Depending on which email address I use, I get significantly different response times: University email - 1 minute, Gmail - 3-4 hours, Yahoo - 1 or 2 days -- which seems bizarre. Has anyone else seen this phenomenon? EDIT: There weren't many responses (even for a bo...

CakePHP: Query in Component?

Howdy, Got question, maybe even problem while creating CakePHP Component. Basically, I need to implement few quesries that can be accesses everywhere in my layout (sidebar statistics and so). When I try to query in Component, I got error about calling function on a non-object. Damn, can anybody explain me this one? Cheers! ...

CakePHP External API aggregation - A Model, Datasource & Behaviour Design Question - Best Practice

Hi, I have a project that requires me to integrate with 2 REST APIs and then aggregate the results. I am building this project in CakePHP My basic approach is: Product (model) Products (controller) API1 (datasource) API2 (datasource) Aggregation (behaviour) The basic flow is: 1. User enters a product name into a search form /products...

[CakePHP] Making a controller for home page

Hello, Can you tell me how to use a controller for home page because i'm trying to put a model's data in home.ctp (homepage view) with <?php $this->user->find() ?>but it returns Notice (8): Undefined property: View::$user [APP\views\pages\home.ctp, line 1] Thanks ...

CakePHP: Few questions about models, controllers an retrieving data

Hello, Again me. I was using for a bit long time KohanaPHP and just can't get familiar with CakePHP, but working with it it's a pleasure for me. First of all, I retrieve data from model, send it via controller to view and now got question. Do I really need to use following syntax of data in foreach loop? $item['Model']['field'] It'...

CakePHP, need suggestion

Good day! I need suggestions how to solve one case while developing app with CakePHP... I got layout created and named default.ctp. In that layout I got sidebar with some blocks and there're some statistics taken from the database. Now my solution: I just created model called Sidebar.php and there're some functions, then I set up data...