cakephp

how $form->error show manually

in my application am showing a popup div form.from that popup form am submitting which controller calls webservice and return the popup automatically closes. Am using ajax->submit for button.I should not close the popup form if an error occur from the controller. How to do this.Also i need to show the relevant error mesage below the par...

How to configure OpenAds in CakePHP?

I want to use OpenAds in CakePHP, how can I install it? I put the OpenAds folder in my vendors folder and tried to change the URL in the Router but it did not work. ...

for( in Array) Error in Jquery while using cakephp variable in JQuery

Hi , In my application , i am trying to use the Php variable in my JQUery . where $viewfields is an array that i retrieve from my cakephp controller. If i tried to use that one like below, i am getting error as for( in Array){\n for(<?=$viewfield;?> in <?=$viewfields;?>){} Please suggest me. What to do so.. Note: i was previously ...

CakePHP array structure from a HABTM query.

I have two tables linked via a HABTM. countries & networks. They are linked together by the countries_networks lookup table. I need to get all of the countries and all of the associated network ids for each corresponding country. I don't need to go as far as getting the network names, simply getting the ids from the lookup table will su...

how to validate from controller

in my application i didnot have model.am using webservice for data.to handle the exception i need use $this->invalidate from controller. Without model how to use that? Thanks ...

Facebook Application made using cakephp is very slow

I have created a facebook application in cakephp. This application is very very slow as compared to other apps. What shall I do to increase it's speed.? Please suggest something as this issue is driving me nuts.. :-( thanks ...

CakePHP Many-To-Many Per-Relationship Additional Data

Hello, I am relatively new to CakePHP, and I am writing a CakePHP application which currently has an Author model and a Book model. Author and Book both have a many-to-many relationship. However, I would like to additionally, for every author-book relationship, have a corresponding link to that author's blog where they reflect upon thei...

what's the difference between model->alias and model->name in CakePHP?

'alias' and 'name' are both properties in cake models. They seem to be similar, but since both of them exist, there must be a difference. What is it? ...

Saving with HABTM in CakePHP

I am creating multiple associations in one go and there are a few problems when it comes to saving. I have the following code: <?php foreach($userData as $user) { $data = array('User' => array('id' => $user['id']), 'Site' => array('id' => $user['site_id'])); $this->User->save($data); } ?> I have experimented with formatting t...

how to get the built in validation error messages of CakePHP displayed?

I am trying to use the built in validation functions of cakePHP for my registration/login page. <?php class User extends AppModel { var $name = 'User'; var $validate = array( 'name' => VALID_NOT_EMPTY, 'password' => VALID_NOT_EMPTY, 'email_id' => VALID...

how to get view's values in controller?

In my controller i want to get the value as $this->data['controlname']. But am using Event.observe for button submit. How do I get the element value in the controller? I am getting null value. in my event.observer i gave "parameters:Form.serialize(Event.element(event).form)," but the value was null in controller. ...

will my "pages" table cause problem for my cakePHP set up

I have table 'pages' in my database. I have noticed that cakePHp has a app\views\pages folder I dont want to use " table prefix " for my database table. Will I have any issues in furture if I create my own pages model and controller files ? ...

setting permissions with cakePHP ACL

I'm using cakePHP ACL feature I'm trying to achieve this case: User 1 can view project 2 but not project 1 My 'aro' table contcains a record for User::1 And 'aco' has a record for ProjectView::2 in 'aros_acos' table i have inserted a record to store this access permission and set '_read' =1 (rest all permissions are = -1) But when ...

Pagination for a variable content document

The project is developed using CakePHP. The page is of a news feed article. Pagination is simple when you want to return (x) number of records per page, or (x) number of images per page, or even limit the number of words/paragraphs/characters but what if you want to paginate by the visual length of the page? The issue came up because...

Where should I put CAS session checking code in a CakePHP application?

I work for a department of a university that uses CAS to provide single-sign-on authentication, and am writing a CakePHP application that needs to use this CAS service. I need to write code that: Checks with the CAS server to see if the user is logged in Pulls some credentials from the server if so Checks the credentials against an int...

alert box in $html->link in cakephp

Hi, I know that the code to get a confirm message while clicking on a link is as given below. <?php echo $html->link('Delete', array('controller'=>'forms','action'=>'delete', $r['Form']['id']), array(), 'really delete the Form ?', false ); ?> I need an alert box saying "Your form has been deleted" after delet...

CakePHP: Shared Hosting Dilemma

Hello, I'm having trouble with uploading my cakePHP project on a shared hosting ( from hostgator ). Here is what I have done: I've organized my cake distribution like this: home/user/app home/user/cake/cake home/user/cake/vendors home/user/cake/.htaccess home/user/cake/index.php I have taken the content of webroot directory from ...

Problem installing cake php

I have installed wampserver on my pc. I unzipped the cake php installation files in the "www" folder of wampserver. Now, when I try to run- "http://localhost/cakephp", I get a whole list of errors along with the cake php getting started page. Here are some of the errors: Deprecated: Assigning the return value of new by reference is dep...

Validation in my CakePHP seems disabled

I'm following the blog tutorial on CakePHP website, but validation doesn't work and i don't understand why, because i'm using the blog tutorial code. I'll report directly from my files anyway... MODEL class Post extends AppModel { var $name = 'Post'; var $validate = array( 'title' => array( 'rule' => 'notEmpty' ...

Simple CakePHP text markup solution for editing news posts

When first searching the web for a simple CakePHP way to convert small news posts (written by a non-technician) I found the flay method in TextHelper. However it turned out that it has been deprecated, referencing to TextileHelper w/ SmartyPants. Textile indeed seems to be a very competent markup language. Nevertheless, I'm afraid it i...