I want to build a forum for my website but I have a question about the
URL structure. I want it to be something like:
example.com/forum/top-category/sub-category-1/sub-category-2/..
(etc).../thread-name/
How would I do this in the routes file? Any thoughts?
--~--~-~--~~~-
Hi Mattalex
You can either use the php function class_exists, which checks if the
class has been defined.
And in case it has not been defined, check for the file in the MODELS
directory.
Enjoy,
John
On Apr 19, 7:37 am, mattalexx wrote:
> Is there any way to know if a model exists if you hav
Is there any way to know if a model exists if you have the name of it
in a string?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To uns
Perfect...
Thanks once again!
Dave
-Original Message-
From: brian [mailto:bally.z...@gmail.com]
Sent: April-19-09 12:23 AM
To: cake-php@googlegroups.com
Subject: Re: AND in query
Both are a part of your conditions, so they both should be in that array.
$q = $this->Bookmark->find(
Both are a part of your conditions, so they both should be in that array.
$q = $this->Bookmark->find(
'first',
array(
'conditions' => array(
'Bookmark.user_id' => $userID,
'Bookmark.post_id' => $postID
Can someone point out how to do an AND query?
In a regular query it would be SELECT Bookmark.id FROM Bookmarks WHERE
Bookmark.user_id = $userID AND Bookmark.post_id = $postID
Just cant seem to figure it out... i just need to see if there is a result
and pass it to the layout
$q = $this->Bookm
Okay, thanks.
By the way, there is nothing about recursion on that page.
On Apr 17, 4:22 pm, AD7six wrote:
> On Apr 17, 11:49 pm, mattalexx wrote:
>
> > 'all joins the other table and doesn't give me an error. 'list' on the
> > other hand, does not join the table and therefore 'array
> > ('Pro
First all of you, How are you?
I am fine . Thanks
Now on Point.
I am new means fresher in cakephp.
My question is how can I show the middle content dynamically on
default page.?
Any body have answer Please reply me.
Thanks
--~--~-~--~~~---~--~~
You received t
Yes, that's what I meant. After poking around in the source for awhile
I agree that it doesn't look possible.
On Sat, Apr 18, 2009 at 3:55 PM, Miles J wrote:
>
> By current action, do you mean the controllers action thats calling
> the validation?
>
> Ive looked and tried before, theres no way t
You could also rewrite your action like so:
function edit($id = null){
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(
'Success.',
'message_succes'
);
} e
Bahaha, yeah I hate when little things like that slip your mind ;)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from th
Thanks a lot Brian,
The second link certainly helped me on the way to a solution!
Also thanks for pointing out my naming error :) That will be fixed!
Enjoy,
John
On Apr 18, 7:50 pm, brian wrote:
> I'm not sure I follow all that but I think these may be some use:
>
> http://teknoid.wordpress
By current action, do you mean the controllers action thats calling
the validation?
Ive looked and tried before, theres no way to do it unless you hack it
up yourself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
OK, I just came across a link to the "on" info in the cookbook (that
table of contents needs an overhaul) but it looks like it only works
with "single rules per field". Bummer.
And GreyCells gives the lowdown on the options array here:
http://teknoid.wordpress.com/2008/09/22/setmerge-and-dynamic
I've been hunting around for the best way to have action-based
validation. I know there's an "on" key that may be used but I can't
find anything online about how to use it properly. Anyone know where
it's documented?
I came across this thread, linked from the FAQ:
http://groups.google.com/group/
On Apr 17, 7:49 pm, Andrew Koebbe wrote:
> So I'm trying to use httpsocket to grab some data on an external
> server, but when I put the uri (let's say 'google.com/search'), I keep
> get a response from my own server saying that the page has permanently
> moved to "mydomain.com/search".
Sounds l
Try this:
"psd" => array(
"minLength" => array(
"rule" => array("minLength", 5),
"allowEmpty" => false,
"message" => "Your message."
)
On Apr 18, 11:42 am, Almaju wrote:
> Hi,
> I really don't understand what are the problems with
Hi Brian,
> YourModel->field(
> 'field_name',
> array('id' => $id)
> )
>
doh! good shout!
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
You received this message because you are subscribed
YourModel->field(
'field_name',
array('id' => $id)
)
On Fri, Apr 17, 2009 at 5:32 PM, mattalexx wrote:
>
> Is there any way to recreate something like this?
>
> $result = mysql_query('SELECT single_field FROM table WHERE id = 1
> LIMIT 1');
> $single_field_value_of_record_1 =
I'm not sure I follow all that but I think these may be some use:
http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/
http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find
Also, your join table should be named "articles_collections".
On Sat, Apr
Thanks for the response, I won't have a chance to test this until
monday. I tried to understand the containable behavior but it just
doesn't seem to be working for me. I'll keep at it. Thanks.
On Apr 17, 9:44 pm, yodi wrote:
> Oopss, i'm forgot Registration, here :
>
> function paginateSearch($i
hey dave,
the long and short of it is: yes, it does impact performance, but for
most people it is negligible. it has it's pros and cons just like
anything, but if you ever are going to scale your app across multiple
servers/clusters/cloud, then uuid is the way to go, due to it's
"unique" nature.
Hi,
I really don't understand what are the problems with my code, see :
function edit($id = null){
if(isset($this->data)){
$this->User->set($this->data);
if(!$this->User->validates()){
$this->Session->
I'm creating an ajax form but it's not working and I can't figure out
why.
The view to the ajax form is:
$ajax->form('/authors/add','post',array('url' => '/authors/add',
'update'=>'DivAddAuthor'));
$form->input('name');
$ajax->submit('Add', array('url' => '/authors/add',
'update'=>'DivAddAuthor'
>> That returns a record, not one string, right?
>
> if you need a string, write a model method to return it:
except that function will NEVER work cause of a typo! try:
function findFieldValue($field, $conditions=array())
{
if (isset($field) && !empty($conditions))
{
> That returns a record, not one string, right?
if you need a string, write a model method to return it:
// Function in a model or AppModel if required application wide
function findFieldValue($field, $conditions=array())
{
if (isset($field) && !empty($condistions))
{
yes to save my data correctly
On Apr 18, 11:55 am, Miles J wrote:
> Yes but why is your data structured that way? SaveAll()?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, se
OMG I just realised that the checkPasswords Function is not supposed
to be in the controller but in the model. Problem solved, I'm
ashamed...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to
It seems that the checkPasswords function isn't the problem at all. If
I do this:
function checkPasswords($data) {
return true;
}
I still get the "Entered passwords does not match" error.
But what could case that? Are my password validation rules wrong
formatted?
'password' => array(
'not
Thx for the tipp, but if I place it in the checkPasswords, I don't get
to see the values:
function checkPasswords($data) {
debug($data, true);
if($data['password'] == $this->data['User']['password2hashed'])
return true;
else
return false;
}
in the core I have: Configure
i know scaffolding, but i want something more specific about optgroup..
no one has used optgroup in this way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake
Put a debug($this->data) within the checkPasswords(). Thatll let you
know if the 2 password fields are being hashed and match.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, se
Yes but why is your data structured that way? SaveAll()?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group,
This is what I use: http://openinviter.com/
Turn it into a vendor and just follow their instructions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@goo
I want to import contact addresses from various email providers to my
appication.
M working in cakephp 1.1.19.6305
I hav found dat i need to include contact grabber..
bt i hav no clue how to proceed further..
M stuck..
Plz... if any 1 cud help me out..
--~--~-~--~~~---
example
$ì=0;
$j=5;
$form->input($i.'.Model1.Model2.'.$j.'.model_id') output ; this work
but if
$form->input($i.'.Model1.Model2.'.$j.'.Model3.model_id') output
; this don't work
understand?
On Apr 17, 10:04 pm, Miles J wrote:
> Still confused on what your asking. Can we see your form code, an
Hi all,
It always lost session if one page redirect to another in my application. I
find the fail reason until today. I had added some codes in my
app_controller to check if the session is valid or not. Like this,
//code
if (!$this->Session->valid()) {
$this->Session->renew();
}
//end
And it see
Ok, fixed the unique problem with just using "isunique" in the
validation, works like a charm. So, now the password check :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send
Dear all,
Having three tables in a standard HABTM configuration:
Model "Article" HABTM model "Collection"
Model "Collection" HABTM model "Article"
Giving the tables "articles" -> "article_collections" ->
"collections".
My goal is to retrieve 4 of the articles which are related to the
collectio
> That returns a record, not one string, right?
you can use the parameter 'list' with limit = 1:
$single_field_value_of_record_1 = $this->find('list', array(
'conditions'=>array( 'table.single_field'=> 1),
'fields'=>array('single_field'), 'limit'=>1 ));
this should give you an array of size 1.
40 matches
Mail list logo