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
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
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 option ... selected to select an item.
However, how can I
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
In view:
?php
echo $html-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');
?
div id=err
?php
echo
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, Steveston [EMAIL PROTECTED] wrote
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
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 -
... ...
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
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
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 current database:
1. CourseComment
2. CourseInstructor
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
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
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
, Steveston [EMAIL PROTECTED] wrote:
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
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 explanation on manual about it.
On Nov 9, 11:07 am, [EMAIL PROTECTED]
[EMAIL
://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, Steveston [EMAIL PROTECTED] wrote:
No standard web pages containing all your search terms were found.
Your search
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.
When visitors go to my website, what is the sequence for my cake app
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 sequence for my cake app
executed
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
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
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 table here
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. users
Users is the parent table
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
repeated from a view page. The problem now is that it will produce
page header
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
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
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
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:
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
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
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)
?php
Very frequently, I need to use codes like this to see output clearly:
$a=print_r($var,true);
echo pre$a/pre;
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
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
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:
?php if (!empty($access['COURSE'])) {
$courseSysFunc =
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] wrote:
Hi there,
I am working
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']=$this-
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;
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!
the method in controller
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
40 matches
Mail list logo