Thanks for the idea, I looked into it a little, but I don't want to
mess too much with the innards of my app as someone else will be
taking it over soon.
What I ended up doing was placing a link next to the empty job number
textbox that opens a new browser tab/window with the job number list
in
I am reading a list of job numbers from a mysql database on an old
server on my intranet. This server is completely independent from the
server for my cakephp app and database. If the server is there, I
populate a combobox with the list of job numbers, however, if it is
down, I would like to
You would put the code to calculate the can_close values for each row
in the model or in the controller.
To put the code in the model, do not use find('all') but create your
own method in the model, for example find_all_model_a. Now in this
function, call $r = $this-find('all'), then iterate
If you print out the contents of the $this-data array ( debug($this-
data) ).
You should see:
[vendor_id] = Array
(
[0] = 1
[1] = 2
)
So that's where you access those values, they are in the array.
On Jul 27, 3:31 pm,
still call it automatically for browser
output, as normal.
On Wed, Jun 3, 2009 at 8:10 PM, qwanta rgmic...@gmail.com wrote:
I am drawing a blank on this one, any help appreciated. Basically my
view is a calibration record that also needs to be saved in a folder
for backup purposes
Experimenting a bit more, it seems that another straightforward way to
do this is use the php function file_get_contents to get a string
with the view.
The advantage is that any view can be accessed even in a different
cake app (as mine is).
On Jun 5, 10:13 am, qwanta rgmic...@gmail.com wrote
I am drawing a blank on this one, any help appreciated. Basically my
view is a calibration record that also needs to be saved in a folder
for backup purposes. Is it possible to save the view as an htm file,
just as if you selected Save Page As in Firefox?
I was looking for a way to sort a table without requerying the
database for the data with a new ORDER clause.
This javascript library I found did just that, so I thought I would
share it.
http://www.kryogenix.org/code/browser/sorttable/
All you have to do is download sorttable.js and place in
Well, I finally got to grips with containable behavior and have
successfully been able to write my find queries to return just the
information I need.
Now I am trying to take this to the next level and put conditions in
the contain array, but I am running into problems. I have found quite
a few
There are a lot of things to like in cakephp, but if I had to say what
aggravates me the most it's the seemingly wasteful and inefficient SQL
calls that cake makes. The first time I turned on debug = 2 I was
astounded at the close to 100 sql calls on a basic page that 1 or 2
SQL statements should
),
'selected' = 'desiredselectvalue') );
On May 4, 3:56 pm, qwanta rgmic...@gmail.com wrote:
In the controller I do a find('list') to get an array ready for
populating a select box. I am quite stumped as to how I would set the
selected index of the select box in the view.
This is a case where
In the controller I do a find('list') to get an array ready for
populating a select box. I am quite stumped as to how I would set the
selected index of the select box in the view.
This is a case where the automagic situation (editing a record) is not
applicable - it is a log entry form and a new
I have a simple database set-up and have optimized the query using
cakephp's containable behavior to where I get only the fields I need
(I check this with a debug command to see the array). However when I
set the debug level to 2 in core.php, I notice many repeat SQL calls
on foreign keys.
For
I had a similar problem (display the logged in username in the
default.ctp header), and used the beforeFilter function in the
app_controller. This is a function that when defined in a controller
will execute before any controller action, so if you place it in
app_controller.php the same code will
In the case where If I have a one to many relationship like Authors-
Books and I would like to delete an author - but only if this author
has no books - is there a buiilt-in way to check?
I find that I run into this situation a lot (every time a table has a
foreign key), and at the moment
at 3:41 PM, qwanta rgmic...@gmail.com wrote:
In the case where If I have a one to many relationship like Authors-
Books and I would like to delete an author - but only if this author
has no books - is there a buiilt-in way to check?
I find that I run into this situation a lot (every time
I am setting a variable value that in app_controller beforeFilter, and
I would like to access it in all child controllers beforeFilter
function.
class AppController extends Controller {
var $components = array('Auth');
var $uses = array('User');
$auth_id = $this-Auth-user('id');
if (
OK, nevermind. Sure enough the second I post, I come up with a
solution (after struggling all morning on the problem).
class AppController extends Controller {
var $auth_role;
}
then refer to it as $this-auth_role in all controllers.
On Apr 10, 11:16 am, qwanta rgmic...@gmail.com wrote:
I am
After struggling a bit with Auth, especially in terms of doing role
or group authentication, I thought I would post what I found out.
Basically each user belongs to a group (admin, calibration,
etc...) and I wanted to set the authorized controller functions for
each group in each individual
I also wanted to mention that if you try this out with a controller
called TestsController, the authentication doesn't seem to work -
everyone (even not logged on) is given access to all functions. I
found this out the hard way! That's why I renamed it to
TrestsController.
I thought the preferred way was to add the models at the top of the
controller:
var $uses = array('Product', 'Category');
But investigating briefly, it seems like there is a performance hit
for this nice syntax - I found the following post at nabble:
Don't use $uses, ever. It is terrible for
Hi tobi_one,
I had the exact same problem and never got an answer:
http://groups.google.com/group/cake-php/browse_thread/thread/6a8bca31cbc37600/68463ae52185dd1a
http://groups.google.com/group/cake-php/browse_thread/thread/e96a87bb82267767
In the end, I abandoned the CakePHP ajax helper and did
I couldn't get that tutorial to work either. It was a while ago, so I
don't remember so well, but here are the notes I took to get something
to work:
***
1) Download the TCPDF files from TCPDF.org (php5 is OK)
2) Extract to app/vendors/tcpdf
For a pure javascript/ajax template, go here http://ajaxphp.packtpub.com/
and download the sample chapter http://ajaxphp.packtpub.com/1825_01_Final.pdf
This should give you a basic working xmlhttprequest that should be
easy to modify to do what you need.
On Oct 17, 11:57 am, bookme [EMAIL
Before looking at the cakephp ajax helper, and the different js
frameworks (prototype, script.aculo.us, jquery etc) I suggest doing a
simple AJAX example in pure PHP/javascript. There's a great tutorial
here:
http://ajaxphp.packtpub.com/1825_01_Final.pdf
which is a chapter from this book
Also, don't forget to restart apache after making the httpd.conf
changes.
On Oct 12, 2:16 pm, imran k [EMAIL PROTECTED] wrote:
Hi everyone! I am Imran k and very new to CakePHP. I have downloaded
cake_1.2.0.7692-rc3 and installed on XAMPP server but the 'welcome
screen' appears without any
You can do this with the query method of the model.
http://book.cakephp.org/view/456/query
It seems like you need to create a dummy table in the database for the
controller so that you can access the method: for the following
example, I had to create the table qs to avoid an Error: Database
I am not an authority on this, but I had a similar problem that I had
to solve.
Basically, it helps to understand that an ajax call gets a simple text
string back from the server. This text string is generated by the
controller function specified in your ajax call. So really what you
want to do
Note that you can use the $useTable property in the model to
explicitly define what table to use in case of doubt/ambiguity.
http://manual.cakephp.org/view/436/useTable
On Oct 5, 11:47 am, Sentinel [EMAIL PROTECTED] wrote:
Hello everybody.
I have a question regarding the convention within
/*\\L/*\\L/*\\M [EMAIL PROTECTED] wrote:
qwanta yes the relationship is that u mentioned.i had did these all
things as u mention, but the error r stuck there and couldnt remove so
4..this error is not from table syntax nor from cake php..but as i
think i didnt define foreign key properly.
-if i
What you probably want to do is take a look at what you have in the
$books array at the end of your controller. A quick and dirty way is
to put a var_dump($books); as last statement in your controller
function. The contents will then show up at the top of your view.
Check if the
Note also you have to have your tables defined according to the
CakePHP syntax. Each one should have an id key column. Then the Book
table should have an author_id field to link the author.
On Oct 3, 2:54 pm, qwanta [EMAIL PROTECTED] wrote:
If it's a one to many relationship (author has many
..
but i m trying to learn some code myself.. :p
- i m trying to made relationship b/w books and authors tables...i think its
relation is not make properly.
-how to make foreign key?..i think thats the problem.
thanx
On Fri, Oct 3, 2008 at 11:13 PM, qwanta [EMAIL PROTECTED] wrote:
What you
On Oct 1, 11:59 pm, David C. Zentgraf [EMAIL PROTECTED] wrote:
'callback' doesn't exist, the only names of callbacks you can use are
listed on the page in my last message. :-)
Oooops, it was getting late
Other than that, you pretty much got it. I always forget what the
variable name is
In traditional javascript you can get the text of the message of an
XMLHttpRequest by doing something like this:
xmlResponse = xmlHttp.responseXML; // xml
textResponse = xmlHttp.responseText; // text
where xmlHttp is an XMLHttpRequest Object that has received a message
from the server.
How do
There's also a couple good tutorials:
http://www.sitepoint.com/article/application-development-cakephp/
http://www.davidgoldingdesign.com/newbie-cakephp.pdf
But they are from 2006, so a little outdated (use .thtml instead
of .ctp extension). Still worth reading for the concepts, and the code
Using pure php/javascript without cakephp, I am able to use the
javascript function
===
document.getElementById(pic).src = imageName;
===
to update an image (when a button on the web page is clicked). this
results in very smooth image updates.
In CakePHP, I have been able to update the
doesn't have this ability built-in, but you
could simply write your own JS for the 'complete'
callback.http://book.cakephp.org/view/211/Callback-Options
On 2 Oct 2008, at 12:12, qwanta wrote:
Using pure php/javascript without cakephp, I am able to use the
javascript function
Hi,
I have been struggling a bit to get a simple Ajax link working. I have
searched this group for help in older posts, but it seems like a key
tutorial (the grahambird one) is no longer available - perhaps because
it no longer works with 1.2.
If there is a tutorial somewhere that covers this,
as protoptype is linked up, then that should work.
On Sep 29, 11:56 pm, qwanta [EMAIL PROTECTED] wrote:
Hi,
I have been struggling a bit to get a simple Ajax link working. I have
searched this group for help in older posts, but it seems like a key
tutorial (the grahambird one) is no longer
it can help someone
struggling with the ajax docs as I was.
On Sep 30, 10:33 am, qwanta [EMAIL PROTECTED] wrote:
Thanks for the reply.
I placed an fwrite statement in ajaxfcn1() and it is writing to file.
So I'm getting as far as triggering ajaxfcn1 now. But the div isn't
updating.
I guess
Not sure if this is the best place to report this, but I couldn't find
any contact info for the bakery.
Basically, it seems like comments cannot be left for articles at the
bakery. There is some problem with the title validation as it reports
a blank field even when there is text in there.
I
42 matches
Mail list logo