For example: a typical university project, I have users, user_courses
(for instructors), user_enrolls (for students), courses, events (each
course have one or more events), groups (each event has one or more
groups), group_members (each group has 1+ members), etc
It is very common for me to get d
Shall I put more database operations in model or in controller. For
example, suppose I need to get all students (name and ID) who
registers in course 101 but did not pay mandatory lab fee. It requires
at least three tables, students, course_registration, and
lab_fee_payment. I can do this in con
If I call Model->create and then Model->getLastInsertID
Will I get the last inserted Id or I must actually create a db record
before calling getLastInsertID?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
I have two list box (A and B), and I have two buttons to move list
items (options)
from this box to the other.I have a submit button to submit the form.
I know how to move items from A to B by using Javascript, and I know
how to use to select an item.
However, how can I select an item after the
In my application, whenever users input, I need to check if some
fields are duplicate frequently (for example, user name, email, course
title, etc). I am using AJAX to do this.
The problem is, I find I am repeating a method again and again in
various controllers.
Basically, in my view, I have so
That's it!
Thanks :)
On Dec 10, 2:50 am, francky06l <[EMAIL PROTECTED]> wrote:
> if (!empty($a)); //I also tried isset, isset & !empty
>
> Is the semi column here a typo ? If not this explains the origin of
> your problem
>
> On Dec 10, 10:29 am, St
In view:
input('User/username', array('id'=>'username',
'size'=>'50'));
echo $html->tagErrorMsg('User/username', 'User name must unique
and
contain at least 5 and no more than 8 chars');
?>
observeField('username', array('update'=>'err',
'url'=>"/users/c
I have a list and I need to populate it either with $array1 or
$array2. Both $array1 and $array2 are returned db query results. I
want to have a check box. So that when I ticket the checkbox, the list
will be populated with $array1; otherwise, use $array2 to populate the
list.
I think it is somet
I need to use $params['controller'] in my app. Everything works fine
except for one controller. It is supposed to be 'users' but it turns
out to be 'courses'. I did a debug and find its call back route is:
index.php ->
Dispatch->dispatch ->
Dispatch->_invoke ->
Controller->render ->
... ...
$par
On Dec 4, 4:26 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Dec 4, 9:49 am, Steveston <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am using the latest pre-beta 1.2.x version. When trying to bake
> > models, get this error:
>
> > Possible Models based on your
I am using the latest pre-beta 1.2.x version. When trying to bake
models, get this error:
Possible Models based on your current database:
1. CourseComment
2. CourseInstructor
3. Course
4. Instructor
5. Source
6. TextbookComment
7. Textbook
8. User
9. UsersTextbook
Enter a number from the list abo
Confused about acl. Please help, thanks a lot.
When calling this method, I need to pass the id for the aro record I
want to delete, right? This id is not user's id in user table, right?
Shall I call this method as $aro->del(field('id','user_id=111', true)?
If cascade is set to be true, other tha
Can I set referential rules in database that once a user is deleted,
corresponding aro's in aro table are also deleted?
Or I must call $aro->del(user_id)?
Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ca
n google.
>
> Also, checkout another great article from a cake
> perspective:http://www.ad7six.com/MiBlog/Blogs/view/Trees
>
> Essentially, the left and right values are what defines the tree and
> the parent / child relationships.
>
> simon
>
> On Nov 9, 10:02 pm, Steve
l the Tree values for you.
>
> Alternatively, learn how MPTT works, and spend a lot of time doing it
> all yourself.
>
> On Nov 9, 8:18 pm, Steveston <[EMAIL PROTECTED]> wrote:
>
> > If lft & right values are required, I am very surprised to see that
> > there is no any
forthcoming cake
> 1.2 manual... when I get round to it - sorry John!)
>
> Simon
>
> On Nov 9, 6:42 pm, Steveston <[EMAIL PROTECTED]> wrote:
>
> > Default values for lft & right codes in aco & aro are NULL.
>
> > If I do not provide lft & right val
Default values for lft & right codes in aco & aro are NULL.
If I do not provide lft & right value (just use default NULL), will
ACL still work correctly?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" g
A user can only modify his own content
Admin can modify anybody's
How to set this permission with ACL?
group-all: Deny all
group-admin: Allow all
group-user: ???
Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
Inheritance is part of Objects ..
> hope this helps
>
> On Nov 9, 12:09 am, Steveston <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
>
> > Say I have a cake app, and I have my own custom app_controller and
> > app_model. I also have some components, say A,B,C.
>
1 shall be
webroot/index.php
On Nov 8, 3:09 pm, Steveston <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> Say I have a cake app, and I have my own custom app_controller and
> app_model. I also have some components, say A,B,C.
>
> When visitors go to my website, what is the
Hi there,
Say I have a cake app, and I have my own custom app_controller and
app_model. I also have some components, say A,B,C.
When visitors go to my website, what is the sequence for my cake app
executed?
I did a debug and it seems the the sequence may be:
1. webroot/app
2. dispatcher.php
3.
Never mind.
I found the problem. It is because I have some course_id in groups
which do not exist in courses.
On Nov 4, 3:50 pm, Steveston <[EMAIL PROTECTED]> wrote:
> I have 6 tables
> 1. course
> 2. groups
> 3. group_members
> 4. group_events
> 5. events
> 6. user
I have 6 tables
1. course
2. groups
3. group_members
4. group_events
5. events
6. users
"Users" is the parent table for group_members
"Courses" is the parent table for groups
"events" is the parent table for group_events
"groups" is the parent table for group_members and group_events
(Parent tab
g to do, and
> why it isn't working for you.
>
> On Oct 30, 9:04 am, Steveston <[EMAIL PROTECTED]> wrote:
>
> > I have an element that I want to render repeatedly. As I cannot render
> > elements directly from controller, I have to render this element
> > repe
I have an element that I want to render repeatedly. As I cannot render
elements directly from controller, I have to render this element
repeated from a view page. The problem now is that it will produce
page header and footer repeatedly as well.
How can I render an element within a page without r
Hello!
When saving data via a form, I can use $html->tagErrorMsg (along with
invalidate function & model validation) to display error message.
However, if I am not saving data via a form, how shall I display error
message?
For example, instead of adding one by form, I am adding many records
by
Does cake 1.2 support backward compatibility for cake 1.1?
Can I just download latest 1.2, extract it, copy its cake folder,
delete my old cake folder, and paste the new cake folder to make my
app run on the top of cake 1.2? I tried, but did not go through.
Thanks,
--~--~-~--~~---
Just replace my old cake library with 1.2.0.5875 pre-beta's new
library, got this error:
Parse error: syntax error, unexpected '.', expecting '(' in C:
\apache224\htdocs\cake\libs\view\helpers\ajax.php on line 723
Checked ajax.php, no syntax error, though.
Any idea why?
Thanks
--~--~
Everything worked properly last week. I did some changes and, for
somehow, the application did not work properly anymore.
I have two forms in my view page:
echo $html->formTag("/users/listUsers");
echo $html->formTag("/users/searchUsers");
Consequently, I have two methods in the controller:
fu
I am confused by how to make ob_start and Controller:render work
together.
For example, in my controller User, I have one function:
addOneRecord($oneUser)
{
...
if ($this->User->save($this->data['User']))
$this->render('userSummary');
...
}
userSummary is a HTML table
I am rendering a view through $this->render('Summary'); (That view is
a html table). After rendering, I will get a complete HTML page.
Now, I want to render that view multiple times (i.e.: many similar
tables with different contents). However, I want to put all those
tables in a single complete H
It takes me much time to figure out why but I run out of luck. Check
manual and API carefully and still cannot make it work.
My codes:
(in controller)
if ($this->User->findByUsername($this->data['User']['username']) )
$this->User->invalidate('username');
(in view)
input('User/use
Very frequently, I need to use codes like this to see output clearly:
$a=print_r($var,true);
echo "$a";
How can convert this piece of code to a program in Vendor so that I
can reuse it?
Thanks,
--~--~-~--~~~---~--~~
You received this message because you are sub
My Question
(Short version)
Can anybody tell me how to capture MySQL error and pass it to end
users?
Is there something like $this->set('db_error', some-built-in-function-
to-get-db-error-msg-as-a-string) in Cake?
PHP has mysql_error function, which returns mysql error msg as a
string. Is ther
correction:
this code snippet is from /app/views/default.phtml
On Jul 31, 12:32 pm, francky06l <[EMAIL PROTECTED]> wrote:
> are you sure you are not using something else (that you should
> mentionned) with cake ?
>
> On Jul 31, 5:57 pm, Steveston <[EMAIL PROTECTED]&g
Hi there,
I am working on a cake app. I find there are many instances of
$access['SOME_CAPITAL_WORD'] in the /view/default.phtml
Can anybody suggest me what does it mean?
Thanks,
The following is a piece of code:
params['controller'] ==
'courses' || $this->params['control
Please first take a look at the piece of code below:
if (isset($this->data['availableInstructors']))
foreach ($this->data['availableInstructors'] as $key=>
$value)
{
$this->UserCourse->data['user_id']=$key;
$this->UserCourse->data['course_id']=$t
in model:
var $validate = array
(
//'username' => '/[0-9]{8}$/',
//'student_no'=> '/[0-9]{8,9}$/',
'last_name' => '/[a-zA-Z]$/',
'first_name'=> '/[a-zA-Z]$/',
//'password'=>'/^.{5,8}/',
'email'=>VALID_EMAIL
);
in controller:
if ($this->User->vali
Follow-up:
Got it worked.
On Jul 6, 9:51 am, Steveston <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I want to edit user's profile and save changes. It is supposed not to
> be a hard task, however, I do not know why I cannot make it work. Any
> help? Many thanks!
>
Hi folks,
I want to edit user's profile and save changes. It is supposed not to
be a hard task, however, I do not know why I cannot make it work. Any
help? Many thanks!
the method in controller is:
function editProfile()
{
$id = $this->rdAuth->id;
$ifChangePassword=false;
40 matches
Mail list logo