cakephp-1.3

Calling function in view of cakephp

Hi, I have one team array and want that team name every where to show team name.It is possible to built a global function which can return team name and I call that function from my view means ctp file. ...

cakephp: problem with PaginatorHelper and routing Plugins, cannot strip Plugin from url

I'm using the Tags Plugin from cakedc.com, and I have a problem generating the proper paging links using the PaginatorHelper. The desired result is to strip the plugin name from the generated hrefs, because the plugin will be added in routing. i.e. http://localhost/tags/photos/oregon/page:4/perpage:28 This is what I have: app/config/...

can CakePHP automatically create tables from models?

In python::Pylons i'm able to issue a setup-app command and it will look at my Models and issue the appropriate CREATE TABLE or CREATE INDEX ddl for my particular database. it seems like this would be a feature in CakePHP, but i'm having trouble finding it. in fact i see this in the manual: "You can create your database tables as you n...

cakephp calling different controllers in one view?

I can't seem to find a method to call different controller in the same view. The closest thing I've found is $html->link("Register User",array('controller' => 'users', 'action'=>'register')). So I did the cakephp's blog tutorial. I have a posts_controller.php, and now I want to add in a star rating system. I googled some stuff and got t...

Share resources among multiple CakePHP webroots on Windows / IIS ?

I've got a CakePHP install running six different web sites, each with their own webroot. All of the base code is the same (controllers, models, etc.), just the css, images, js and so forth are split into the separate webroots (app/webroot, app/webroot_second_site, app/webroot_third_site, etc.) My question is: Is there a way to share co...

To models using the same table but with conditions in CakePHP

I have two models that I would like to save in the same table. For instance I have a status model and a payschedule model both should be saved in the statuses table. But at retrieving the status model should return only the records with payment = 'no' and the payschedule only records with payment = 'yes'. I will have a before save in e...

cakePHP, retrieving records after now

Hey, I've got an element that does a requestAction to grab records sorted by date. What I haven't been able to workout/find is how to restrict it to only include records who's date is after now. For example, in my element I something similar to: $stuff = $this->requestAction('stuff/get_stuff/sort:my_date/direction:asc'); How should I...

How to redirect to captcha for x failed attempted without circular redirects in CakePHP?

I am using the core Auth component. I have created a user login that manages all of the permissions. The way I am implementing the login monitoring is by checking for $this->Auth->user() in the app_controller. Each time the app_controller cycles the beforeFilter() function and !$this->Auth->user(), it will increment the Captcha.LoginAtte...

how to pass the result of custom query in pagination

hi i am using cakephp for my project but i have problem when i generate result from custom query. then i have no idea about that how to that result in to pagination. so please help me. thanks in advance. ...

use of hidden field for checkboxes in cakePHP

What is the use of hidden fields for checkbox in cakePHP?? ...

CakePHP - combine ACL with REST API

i created an application with some models, after that, i used ACL and created some ACOs to protect my Application. Now i wanted to add a RESTful API to my application, so i edited routes.php with something like that Router::mapResources('routes'); Router::parseExtensions(); this also works fine, for example going to http://localhost...

Convert query into cakePHP find statement

hello friends, Any one please help me to convert this query into cakePHP find statement? $sql = "select categories.id FROM categories WHERE categories.competition_id='".$id."' AND ". $logger['Competitor']['weight']. " betwee...

CakePHP, organize site structure around groups

So, I'm not quite sure how I should structure this in CakePHP to work correctly in the proper MVC form. Let's, for argument sake, say I have the following data structure which are related in various ways: Team Task Equipment This is generally how sites are and is quite easy to structure and make in Cake. For example, I would have th...

How do you use CakePHP Auth component across subdomains?

(Using CakePHP) I'm looking to setup a sub-domain for user creation, password changes and credit card information vies...as in: secure.mydomain.com (https) - User/Create - User/Login - User/UpdateCreditCardInfo app.mydomain.com (http) - once logged in using the "secure" site, the user will be able to access application specific views ...

CakePHP 1.3, Form Helper and Self Joined Table

Hi everyone, My Self Joined Categories table is as follows: id, name, description, parent_id I used Cake Bake to generate the Model, Controller and Views. Model has the $belongsTo and $hasMany association set up. In add() of the controller, $parentCategories = $this->Category->ParentCategory->find('list'); $this->set(compact('parent...

How do I treat multiple API functions for a single CakePHP DataSource ?

I am using CakePHP 1.3. I have successfully created an Indeed DataSource and am looking to create more complicated ones. I am looking into creating a Yahoo Answers DataSource and was wondering about a few best practices. The API exposes a few functions: 1) Ability to search for questions 2) Ability to get questions in a category 3) Ab...

How do I make cakePHP's form helper 'create' action use a custom id? Or some other work around...

I'm building a site that requires multiple forms for the same model in varying numbers throughout a single page. These forms belong to an object with an id. Currently, since I can't figure out how to change the form ids, I'm stuck with a hole bunch of duplicate ids. I'm looking for a way to append the object id to the form id so they're...

Custom Login Function with CakePHP's Auth Component

I need to know how to customize the login function that I am using with the Auth Component. Currently, it is blank and being handled automatically by the component. I need to add some conditions in it that which I want to execute before login happens. ...

TCPDF QR Code is different all the time

I've got TCPDF installed in CakePHP 1.3 and am using it to generate a PDF of a QR code. It's a very simple function that creates a A9 sized page, two strings and one QR code. The QR code is for a simple url (ie. 'example.com/12345'). I can load the page in a browser (Safari using it's built in PDF reader.) and each time I reload it, t...

Error while running the cakephp

Hai friends, I got the following error while running the cakephp code. How can I solve this problem. Fatal Error (256): Unable to load DataSource file dbo/dbo_pqsql.php [CORE/cake/libs/model/connection_manager.php, line 189] Thanks in advance... ...