;
> Wayne
>
> On 10/22/07, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Oct 22, 9:44 pm, skyblueink <[EMAIL PROTECTED]> wrote:
>
> >
> > Did you try any of your questions? You could have checked all of those
> > possibilities in less t
As you know, the distinction between singular and plural forms of
nouns is important in Cake naming convention. That is, model names
(class names and file names) are supposed to be singular, while table
names, controller names and view names are to be plural.
For example, we have LineItem and lin
Sorry, this is not CakePHP stuff, but javascipt stuff.
When we fire a javascript function through "onLoad" event, it works
through two steps like the following:
(1) First, the page is loaded.
(2) Javascript function is fired.
This is the definition of onLoad event, and we all know that the STOP
The code below, using prototype and Ajax, populates 3 s. But,
once the page is loaded and Event.observing is acting, can I stop the
populating with a click button? I thought Event.stop() and
Event.stopObserving() should come, and did some tries but failed.
Event.observe(window, 'load',function(e
Using AJAX and onLoad event, we do populating many s and it
generally takes relatively long time to complete the page loading,
which makes the STOP button indispensable.
The following code generates 9 s and 9 onLoad events to populate
them. It works great, but once the onLoad events are fired, th
When you point your browser to http://localhost/users/ , cakePHP
searches for an index action in users_controller.php, and an
index.thtml. So you must add them.
/app/controllers/users_controller.php
/app/views/users/index.thtml
On 4월4일, 오전7시00분, "Dave" <[EMAIL PROTECTED]> wrote:
> I tried
</title>
> <script type="text/javascript" src="app/webroot/js/prototype.js">
>
> function execute() {
> var item = $('sample');
> Element.update(item, "Hello!");
> }
>
>
>
>
> element
> element2
>
I know this is not a CakePHP problem, but related to it. The simple
example below does not work in IE and FireFox. I don't why, but the
PHPEd debugger gives a messge "OBJECT is required". I have some
experiences in using prototype in CakePHP, but I'm trying to go more
deep into prototype by learni
Next snippet is supposed to show 10 s, each displays the loading
time. Loading time is the difference between endTime and startTime:
startTime and endTime was given by javascript Date.getTime method at
the time of 'loading' and 'complete' for each run of $i. But the
calculated time is always 0, th
bit and put the direct link in.
>
> On Mar 25, 11:06 am, "skyblueink" <[EMAIL PROTECTED]> wrote:
>
>
>
> > The following index.thtml gives a Google link
> > ofhttp://www.mydomain.com/tests/http://www.google.cominsteadofhttp://www.google.
The following index.thtml gives a Google link of
http://www.mydomain.com/tests/http://www.google.com instead of
http://www.google.com. What shoud I do to get get the correct link?
-index.thtml-
function insertScript(){
var sHTML="
I'm updating the with id = indicator to show the progress of
page loading whenever every content(that is, s with id = view0,
view2, vie3,...,view9) is displayed.
for ($i = 0; $i < 10; $i++){
$view = 'view' . $i;
echo "";
$options = array(
'update' => "$view",
'url'
Thanks, Kjell!
On 3월12일, 오전12시23분, "Kjell Bublitz" <[EMAIL PROTECTED]> wrote:
> Give the "view" divs a class... lets say "view"
>
>
> Then you can go like this:
> $$('.view').invoke('hide');
>
> thats it :)
>
>
//index.thtml
link('FAQ/HELP', '/books/faq', array('update' =>
'faq')); ?>
";
options = array(
'update' => "$view",
'url' => "/books/lister/?id=$i,
'type' => 'asynchronous',
'loading' => "Element.hide($view);",
'complete' => "Effect.Appear($view);"
);
echo $javascript->event('window
Hi, Bakers!
I succeeded in loading 10 divs in sequence, using the following
snippet.
But, my question here is how to stop the page loading after it started
loading.
I tried both link('STOP',"javascript:window.stop()" ); ?>
and link('STOP',"javascript:document.execCommand('stop')" ); ?>
in IE6 an
Thanks, Sergei and Grant Cox.
Both of your suggestions works.
On 2월18일, 오후2시23분, "Sergei" <[EMAIL PROTECTED]> wrote:
> "url" => "/books/lister/?id=1&display=" . $mydisplay,
>
> see the difference?
>
> On 18 фев, 04:53, &quo
I know this in not a Cake problem, but I think it's what we come
across frequently in real world.
'view',
'url' => '/books/lister/?id=1&display=$mydisplay',
'type' => 'asynchronous',
'loading' => "Element.hide('view');",
'complete' =>
"Element.show('in
//index.thtml
'orange' ,'color'='yellow',
'food'='spaghetti')
$options = array(
'update' => 'view',
'url' => '/demos/hello/',
'complete' => "Effect.Appear('view')"
);
echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
?>
//index.thtml
Hi, the preceding example shows index.thtml, and I want javascript
update the div (id=test) three times on the client side without using
any view files such as 'url' => '/demo/test' so that the div is
updated to show the $test strings, i.e. "first", "second", and "third'
in s
'loading',
'complete' => "Element.show('loading')"
);
echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
?>
'loading',
'complete' => "Element.show('loading')"
);
echo $javascript->event('window','load',$ajax-
>remoteFunct
Hello, bakers!
In the example below, I'm calling two ajax requests in sequence so
that two divs(id=view_first, view_second) are updated totally
independantly. Since updating requires some time, I have a "progress
bar" div(id=loading) to show which div is being updated. But
currently, only "Loading
index.thtml
link('Click', '/sparks/update', array('update' =>
array('first', 'second'))); ?>
div first
div second
update.thtml
div('first'); ?>
divEnd('first'); ?>
div('second'); ?>
divEnd('second'); ?>
Hello! The preceding snippet is an example of multi update, and
works greatly, but in a w
Here is a very simple and useful code.
(original code: http://cakebaker.42dh.com/2006/06/29/how-to-update-
multiple-divs-with-ajax/ )
1. sparks_controller.php
layout = 'ajax';
}
}
?>
2. index.thtml
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; lang=
> wrote:
2007/1/3, skyblueink <[EMAIL PROTECTED]>:
> I have no choice but to call $this->set() one thousand times in
> Controller, and write foreach statement one thousand times in View.Maybe you
could make myfunction() a little bit more intelligent?
function myfunction(
Thanks Chris, I'll answer you in other thread.
On 1 4 , 6 00 , "Chris Hartjes" <[EMAIL PROTECTED]>
wrote:
On 1/3/07, skyblueink <[EMAIL PROTECTED]> wrote:
> Yes, surely it will give the output I wanted. Thank you for your work,
> but what if I have to c
1. MODEL
$this->Test->scraper($shop, $author)
The function scraper() gets $shop(the name of a internet bookshop site)
and $author as arguments and returns a title list of the first 10 books
being sold there with $author as the author.
$booklist = $scraper('amazon','Shakespeare');
will return.
Yes, surely it will give the output I wanted. Thank you for your work,
but what if I have to call myfunction one thousand times?
$this->set('fruits', $this->Test->myfunction(1));
$this->set('animals', $this->Test->myfunction(2));
.
$this->set('colors', $this->Test->myfunction(1000))
일, 오전1시35분, "skyblueink" <[EMAIL PROTECTED]>
wrote:
Hi, rpetrain1
yes there is also a synchronization problem between the controller and
the view.
I know that $this->set doesn't do appending, but appending is time
consuming in real life. What I aim at is 'not appending':
Hi, rpetrain1
yes there is also a synchronization problem between the controller and
the view.
I know that $this->set doesn't do appending, but appending is time
consuming in real life. What I aim at is 'not appending': instead of
appending string data, I want to send each datum to view so that
r ($i = 1; $i <= 3; $i++) {
echo "i is " . $i . "";
}
}
I'm a newbie in CakePHP, but this lack of "on the fly" output in loops
seems to be resident in MVC frameworks such as Cake.
On 1 4 , 12 25 , "Chris Hartjes" <[EMAIL PROTECTED]&
I have a very simple program.
Here is the controller.
set('message',"i is " . $i . "");
}
}
}
?>
And here is the view.
I expected an output like:
i is 1
i is 2
i is 3
but the actual output was:
i is 3.
Does this mean we can't $this->set in a loop? Or am I making a mistake?
I just want
but I'm not sure how your doing your
sequential outputs, or how you are calling pass.
Yeah, that's the problem, and I think it maybe the limitation of
CakePHP or in general MVC frameworks.
In actual, we can't get the desired output since we can't do the
sequential outputs, call pass().
On 1
hermore, to delimitate the sequential outputs, placing headers
would be better.
Header 1: fruits are here.
lemon
banana
apple
Header 2: animals are here.
lion
tiger
monkey
Header 3: colors are here.
red
blue
green
On 1 3 , 2 09 , "TJSingleton" <[EMAIL PROTECTED]>
wrote:
skyblu
if ($i == 3) echo "Now, colors are being collected.";
$result = $this->Test->myfunction($i);
for ($j = 0; $j <= 2; $j++) {
echo $result($j);
}
}
On 1 3 , 1 13 , "skyblueink" <[EMAIL PROTECTED]>
wrote:
OK, thanks to the
OK, thanks to the help of kind people here I've got a working simple
example program(see below).
=The Example Code=
-test.php includes next lines
Test->myfunction($i));
}
$this->set('result',$result);
}
}
?>
-And, pass.thtml includes next lines.
";
}
?>
Currently, he output is:
lemon
Thanks, nate & gwoo!! It works!
By the way, please replace my Model with the next correction to run the
example code. I made a mistake.
On 1 2 , 7 59 , "gwoo" <[EMAIL PROTECTED]> wrote:
am() is a basic Cake function.
Download the CakeSheethttp://cakephp.org/cakesheet.pdf
or
Get a life si
Thanks, nate!
But what is 'am'
in $result = am($result, $this->Test->myfunction($i)); ?
Is it a PHP function or a CakePHP function (I can't figure out right
now)?
On 1 2 , 6 23 , "nate" <[EMAIL PROTECTED]> wrote:
The problem is in pass(). If you keep set()ting a variable of the same
name,
If you're following along with the blog tutorial withoit any
modifications of the example code, your intex.thtml and view.thtml
should be in app/views/posts/ instead of app/views/pages/. The error
message is already saying that ithey shoud be in
/.../httpdocs/app/views/posts/. As you know, Cake i
-test.php includes next lines.
-tests_controller.php includes next lines.
Test->myfunction($i);
$this->set('result',$result);
}
}
}
?>
-And, pass.thtml includes next lines.
";
}
?>
The run cakephp/tests/php gives only "colors":
red
blue
green
But, what I want is to get all of
41 matches
Mail list logo