I'm in the process converting our CakePHP-built website from Pervasive to SQL Server 2005. After a lot of hassle the setup I've gotten to work is using the ADODB driver with 'connect' as odbc_mssql. This connects to our database and builds the SQL queries just fine.
However, here's the rub: one of our Models was associated with an SQ...
Hi,
I would like return some records from my base (eg. users roles)
And I use usually function find(), findAll(), etc., and I always must write 'conditions' with like this: not display role admin (name!=admin).
My question is, how I can in RoleModel set for all function will be return with this conditions.
Sorry for english!
Bye!
...
Hi all,
I'm trying to let a user to do a 'Click here to add more info' link. I'm trying to do this with input fields so that the id of the field have to increment.
I would like for jQuery to add this on every click where $i is the number of each field incremented:
<div id="info"></div>
<?php echo $form->input("User.$i.first_name"); ?>...
Hi there,
I'm fairly new to CakePHPand am building a site using the Auth component. A couple of times I have tried to do things with this component which have caused the error
Fatal error: Call to undefined method stdClass::user() in /ftphome/site/app/controllers/users_controller.php on line 395
The line it refers to in this case is
...
I am at a loss. I submit a form via Ajax using
submitForm: function(element) {
$.post(
webroot + 'users/settings',
$('#AJAXform').serialize(),
function() {
var option = $('#AJAXform').find('select option:selected');
$j.current.v.updateField(element, option.text());
$j.curre...
I am using CakePHP "HttpSocket" class to post information to a Paypal payments server. My code is working fine when the target URL is http://www.something.com, I can parse the response as I would like.
However, when I am trying to post data to PayPals payment API URL (on HTTPS) I get no response whatsoever.
I have tried the same code o...
I create table: id, name, thread_id
The mainly thread has thread_id = 0, but their children has theard_id = id of parent, and how is the best and simplest solution to create list with children, and looks like:
Category 1
Product 1
Product 2
Category 2
Product 3
etc...
Maybe You have better solution for such a list?
Sorry, for my eng...
I am working on a project in cakephp where one app will support multiple sites using different domains. This is an issue when using view caching where it only matches to the end part of the url and ignores the host.
Is there a way to prefix view caching with the host so that there isn't any conflict across different sites?
...
Is it possible in CakePHP to have URL aliases in routes.php? Or by what other means can achieve something equivalent:
Lets assume I have some paginated views. Among the possible orderings there are particular ones I want to bind to a simple URL. E.g.:
http://example.com/headlines => http://example.com/posts/listView/page:1/sort:Post.c...
hi,
this is the dropdown list link in my edit page
when editing it selects the friend automatically, but i want it shows 'select your exiting friend' by default(whenever the page loads)..
echo $form->input('PostCard.friend_id',array('label'=>_l('Friend Name List'),'empty'=>_l('Select Your Existing Friend'),'options'=>$friends));
...
How do you rewrite a website to be scalable?(traffic) I work with mainly PHP and some Ruby on rails and i know its a generic question. I'm just looking to increase my knowledge so any advice would be useful.
Thank you in advance ;-)
...
Hi Guys,
I have go TCPDF setup in my cake php install and am now trying to also use FPDI with it as i need to add a PDF to the start of the PDF that is being generated.
WHen trying to do this i am using 3 classes
XTCPDF which holds my header data
FPDI - FPDI class
TCPDF - TCPDF class
and it is setup as so:
XTCPDF extends FPDI
FPDI...
The application I'm building is a tennis draw, which has a list of matches organized by round. I've also given the matches a position number as a way to order them and manage matches that are at the top of the draw. In a 32 player draw there are 16 matches in the first round, with match positions ordered from 1 - 16.
The draw is laid ou...
I'm trying to create an XML sitemap using CakePHP, from a table which has more than 50,000 records at the moment, each record equivalent to a URI in the sitemap. Now the problem I'm facing is CakePHP is running me out of memory while generating it, for two reasons:
A find('all') is building a huge associative array of the entire set of...
Hi I'm using fullcalendar, jQuery and CakePHP. When using the clientEvents function I get all of the calendar events in an array of objects. I then pass that array to an action via jQuery's $.ajax of type post. But when I inspect the post data I get something like:
Array
(
[undefined] => undefined
)
What seems to be the problem?
...
Trying to integrate CakePHP and jQuery, using next example
http://bakery.cakephp.org/articles/view/dynamic-select-boxes-with-ajax-jquery
What I want is to when user change first option element, to automaticly fill second select option box with proper values. But, nothing happens, if you can help me why.
So, there is a Invoice add for...
My table 'Post' has field: id, name, content, post_id
When i create new post, the field 'post_id'=0, but when I "answer" to Post, the field 'post_id' get id off answered post ID.
My question is, how get post by slug field width post_id=0 (parent) and get his children with 'post_id' = parent.id in one query?
...
I have loads of model functions returning different datasets already.
I would like to be able to paginate these without having to rewrite them all using the paginate method in the controller. Is there a tidy way of doing this?
...
In my controller I have model operations that can return empty results. I've setup the view to display the results using a foreach loop. But if the model opertion is empty and returns no results then the foreach loop is breaking in my view.
This is the operation:
$match3 = $this->Draw->Match-> find('all',array('conditions'=>array('Matc...
How to create select/option html tag from find('threaded') data in CakePHP?
Function find() return results like this:
Array
(
[0] => Array
(
[Forum] => Array
(
[id] => 1
[name] => Forum
)
[children] => Array
(
...