Re: pass parametrs

2012-08-29 Thread Mohammad Naghavi
Nareh,
please try to start reading some basic tutorials about php, not the cakephp
itself, then the blog example from cake's book. What you are asking for and
what you asked for yesterday, shows that you need at first some info about
how http, html and php work at all then you can start with a framework like
cake.

regards,
MN


On Wed, Aug 29, 2012 at 9:49 PM, Nareh Tarasyan wrote:

> Yea, i know itbut i want other thing
>
> For example when I click on some username, it opens all information about
> the user and in address writes: ./?id=1
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How to set a variable inside an extended Cake Class

2012-08-29 Thread Chetan Patel
Write below router in route.php

Router::connect('/cms_pages/:action/*',
array('controller' => 'cms_pages', 'action' => 'view'),
array(
'routeClass' => 'SluggableRoute',
'your_variable_name' => array('your_variable_value')
));

Write below code in  a file in app/libs/Sluggable_route .php

class SluggableRoute extends CakeRoute {

function parse($url) {
$params = parent::parse($url);

if (empty($params)) {
return false;
}

if (isset($this->options['your_variable_name']) &&
isset($params['_args_'])) {
// Do something
}
 }

}

-- 
Thanks & Regards

Chetan Patel

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How to set a variable inside an extended Cake Class

2012-08-29 Thread lowpass
CakeRoute doesn't talk to View. You can set params to be passed to the
controller, though. For example (in parse method):

$params = parent::parse($url);

...

$slugs = array_flip(Set::extract("/Page/slug_${params['lang']}", $data));

if (isset($slugs[$params['slug']]))
{
$params['pass'][] = $params['slug'];
return $params;
}

On Wed, Aug 29, 2012 at 3:50 PM, Leonhart  wrote:
> Hi guys
> I'm stuck on a new problem these hours... I've just coded an extended
> CakeRoute and I need to set some variables. Unfortunately, the $this->set()
> function can't be used as it points to the extended CakeRoute class. How can
> I set a variable inside the parse() function for showing it inside the view?
>
> I really thank all of you for your suggests.
> Leonhart
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How can I Show my Database Global Variables and Full Process List?

2012-08-29 Thread lowpass
Works for me:

$q = $this->Post->query("SHOW FULL PROCESSLIST");
die(debug($q));

Of course, debug needs to be enabled, and caching disabled. Have you
checked that?

On Wed, Aug 29, 2012 at 2:24 PM, andrewperk  wrote:
> Hello,
>
> I need to be able to print out some data from my database such as:
>
> "SHOW FULL PROCESSLIST"
> "SHOW GLOBAL STATUS"
> "SHOW GLOBAL VARIABLES LIKE 'hostname'"
>
> etc..
>
> How can I accomplish this? What I've been trying to do is use the query()
> method in a model to run my own custom query but that's not working:
>
> $this->query("SHOW FULL PROCESSLIST");
>
> This doesn't return anything, there is no error either, it's just empty. Any
> help would be appreciated.
>
> Thanks,
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: node in Acl behavoir

2012-08-29 Thread lowpass
Does your model have AclBehavior set up?

public $actsAs = array('Acl' => 'controlled');

On Tue, Aug 28, 2012 at 12:07 PM, Elhelaly  wrote:
> Using Cakephp 2.1.2
> I am trying to make a method to generate the Aco's (check if there is a new
> controller or methods and add it in aocs table)
> I have a problem with using the node method , get this error
>
> Database Error
>
> SQL Query: node
>
>
> my method code in usersController.php
>
> public function admin_generate() {
> $this->loadModel("Aco")
>
>$root = $this->Aco->node('controllers');
>
> }
>
>
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Paginate Multiple Models in the same view

2012-08-29 Thread Betsabe Quiroz
Hi everyone.

I did this:

$this->paginate = array( 
'limit' => 10, 
'conditions' => array(' Model1 .eliminado'=>'0'), 
  ); 
$model1 = $this->paginate('Model1'); 

$this->paginate = array( 
'limit' => 10, 
 ); 
$model2= $this->paginate(' Model2'); 

$this->set(compact(' model1  ',' model2 '));


And that works for me, i hope this ccan help you!

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




How to set a variable inside an extended Cake Class

2012-08-29 Thread Leonhart
Hi guys
I'm stuck on a new problem these hours... I've just coded an extended 
CakeRoute and I need to set some variables. Unfortunately, the $this->set() 
function can't be used as it points to the extended CakeRoute class. How 
can I set a variable inside the parse() function for showing it inside the 
view?

I really thank all of you for your suggests.
Leonhart

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: pass parametrs

2012-08-29 Thread Nareh Tarasyan
Yea, i know itbut i want other thing

For example when I click on some username, it opens all information about 
the user and in address writes: ./?id=1

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: pass parametrs

2012-08-29 Thread Paul Willis
http://book.cakephp.org/2.0/en/controllers.html#Controller::set

Paul

On 29 Aug 2012, at 19:59, Nareh Tarasyan  wrote:

> How do you pass parameters from controlller to view?
> 
> For example:
> 
>  echo "".$i." 
> "."";
>  How to do it in cake?
> 
> -- 
> 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, send email to 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>  
>  

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




pass parametrs

2012-08-29 Thread Nareh Tarasyan
*How do you pass parameters from controlller to view?*
*
*
*For example:*
*
*
* echo "".$i." "."";
*
* How to do it in cake?*

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




How can I Show my Database Global Variables and Full Process List?

2012-08-29 Thread andrewperk
Hello,

I need to be able to print out some data from my database such as:

"SHOW FULL PROCESSLIST"
"SHOW GLOBAL STATUS"
"SHOW GLOBAL VARIABLES LIKE 'hostname'"

etc..

How can I accomplish this? What I've been trying to do is use the query() 
method in a model to run my own custom query but that's not working:

$this->query("SHOW FULL PROCESSLIST");

This doesn't return anything, there is no error either, it's just empty. 
Any help would be appreciated.

Thanks,

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Yasir Arafat Hasib
try this

http://arafats.info/cakephp-findbyfieldname-data-read/

On Wed, Aug 29, 2012 at 4:08 PM, Nareh Tarasyan wrote
:

> Hey, ppl. help me.
> I try this code:
>
>  IndexsController.php
> $this->set('x', $this->Word->findByid(10));
>
> then
> view/Indexs/index.ctp
> echo "word= ".$x;
>
> It echoes
>
> word=Array;
>
>
> What is the problem??? When I have loaded Word model in my
> IndexsController, and I have a record with id=10 in db table. :/
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>



-- 
*Thanks & Regards.
-
Yasir Arafat (Hasib)*
*Deputy Project Manager, *Software Solutions
Grameen Solutions
Contact Information:
**
**
Cell : +8801816 536 901, +880197 *333* 2 888
Web: http://arafats.info


-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread Mohammad Naghavi
Thanks all now I found the error source.
I already have tried all the possible orders for defining the routes but as
said before it was not the source of error. the problem was with the
trailing slash on this rule:
Router::connect('/my-controlle**r/', array('controller' => 'my_controller',
'action'=>'index'));
it should be
Router::connect('/my-controlle**r', array('controller' => 'my_controller',
'action'=>'index'));
and has to be defined *before *other one with :action parameter and both
before the default route rules.
so now I am up and running with hyphens.

regards,
MN



On Wed, Aug 29, 2012 at 6:05 PM, AD7six  wrote:

>
>
> On Wednesday, 29 August 2012 17:16:58 UTC+2, Mohammad Naghavi wrote:
>>
>> we are all trying to contribute something back into community, so if you
>> want to help please do
>>
>
> I don't know your contribution - but I have and I do,
> https://github.com/cakephp (find me)
>
>
>> if not don't try to change the whole world match your needs just because
>> you don't like it.
>>
>
> One of the types of threads I reply to, are the ones where a simple
> question goes on for days because the advice given is misleading, going
> nowhere or just plain wrong.
>
> Routes aren't the simplest part of cakephp but I repeat: routes are not
> magic.
>
> The logic for routes is pretty simple:
>
> foreach routes as route
>   does it match?
> return route
>   }
> }
>  handle unmatched route
>
> If the route _your_ url reverse-matches is not the url(string) you expect
> - it's because the route _doesn't_ match the array you're passing it or
> matches another route before finding the one you're expecting.
>
> I use colors to recognize my text from others as fast as possible. If you
>> don't like it, it doesn't mean it is useless!
>>
>
> Sure - but it does continue to dissuade me from reading beyond word 1 on
> the thread.
>
> AD
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: complex find()

2012-08-29 Thread Mancho
Are you sure the field exists in the database?

--
Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: complex find()

2012-08-29 Thread rockbust
That did not work either.



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/complex-find-tp5710758p5710795.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread AD7six


On Wednesday, 29 August 2012 17:16:58 UTC+2, Mohammad Naghavi wrote:
>
> we are all trying to contribute something back into community, so if you 
> want to help please do 
>

I don't know your contribution - but I have and I do, 
https://github.com/cakephp (find me)
 

> if not don't try to change the whole world match your needs just because 
> you don't like it. 
>

One of the types of threads I reply to, are the ones where a simple 
question goes on for days because the advice given is misleading, going 
nowhere or just plain wrong.

Routes aren't the simplest part of cakephp but I repeat: routes are not 
magic.

The logic for routes is pretty simple:

foreach routes as route
  does it match?
return route
  }
}
 handle unmatched route

If the route _your_ url reverse-matches is not the url(string) you expect - 
it's because the route _doesn't_ match the array you're passing it or 
matches another route before finding the one you're expecting.

I use colors to recognize my text from others as fast as possible. If you 
> don't like it, it doesn't mean it is useless!
>

Sure - but it does continue to dissuade me from reading beyond word 1 on 
the thread.

AD

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread Mohammad Naghavi
we are all trying to contribute something back into community, so if you
want to help please do it, if not don't try to change the whole world match
your needs just because you don't like it. I use colors to recognize my
text from others as fast as possible. If you don't like it, it doesn't mean
it is useless!

regards,
MN


On Wed, Aug 29, 2012 at 5:10 PM, AD7six  wrote:

>
>
> On Wednesday, 29 August 2012 16:45:39 UTC+2, Mohammad Naghavi wrote:
>>
>> I don't consider the color change unnecessary, the time of HTML emails
>> was a long time ago started. if you have color problems use a terminal
>> email client.
>>
>
> Except google groups is primarily a web application.
>
> In any event I'm happy to not offer advice to those who don't want it.
>
> AD
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread AD7six


On Wednesday, 29 August 2012 16:45:39 UTC+2, Mohammad Naghavi wrote:
>
> I don't consider the color change unnecessary, the time of HTML emails was 
> a long time ago started. if you have color problems use a terminal 
> email client.
>

Except google groups is primarily a web application.

In any event I'm happy to not offer advice to those who don't want it.

AD

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Related models in TestCases

2012-08-29 Thread Boyan Penev
Hello,

i am having following problem: $this->Model->find() doesn't get past the
own model in a Test Case. For example,
i have Comment belongsTo Article with public $belongsTo = array( 'Article'
=> array('className' => 'ArticlesPlugin.Article', 'foreignKey' =>
'article_id')) in the Comment model
and public $hasMany = array('Comment' => array('classname' =>
'ArticlesPlugin.Comment','foreignKey' => 'artilce_id')). The foreign keys
are present and properly set.
I have set the recursion in the Test case to '2' (don't know if thats
needed?).
The association is working in the $default database connection, even if
using the sql-dump of the test database (using fixtures for the tests) as
data.
So to sum it up- the association is working in the application, but not in
the test case. Is there something more that needs to be done in order for
the Test case
to access related models?

Thanks, Boyan

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
Yeah, Mark, I also thought so and tried, but it doesn't work. Doesn't echo 
anything :/

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread Mohammad Naghavi
I don't consider the color change unnecessary, the time of HTML emails was
a long time ago started. if you have color problems use a terminal
email client.
thanks for the suggestion however, I have already tried any possible order,
it relies on the cake implementation I think for what I don't have time to
dive in right now, but I would let others know if I find the reason.

regards,
MN


On Wed, Aug 29, 2012 at 4:38 PM, AD7six  wrote:

>
>
> On Wednesday, 29 August 2012 16:17:51 UTC+2, Mohammad Naghavi wrote:
>>
>> @Sophistry: tried that, no changes.
>>
>> @AD7six: as stated also before, I have this route too, but nothing
>> changes:
>> Router::connect('/my-controlle**r/', array('controller' =>
>> 'my_controller', 'action'=>'index'));
>>
>
> Some debugging perhaps then. One of the reasons I haven't read any of
> this thread, is the needless change in text colour. Would you mind
> writing in a color that I can read?
>
> Google groups is .. starting to chaff.
>
> Routes are order sensitive - so unless I missed where you stated your
> whole routes file before - your problem is likely the order you've defined
> the routes.
>
> AD
>
> --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread Mark Wratten
$this->set('randword', 
$this->Word->findById(rand(1,$this->Word->find('count';

On Wednesday, August 29, 2012 10:24:26 AM UTC-4, Nareh Tarasyan wrote:
>
> Thanks Marcus
>
> but u know what I did here... see:
>
> $this->set('rand', rand(1,$this->Word->find('count'))); 
> $this->set('randword', $this->Word->findById());
>
> I want ID= value of rand function, but don know how to write it.
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread AD7six


On Wednesday, 29 August 2012 16:17:51 UTC+2, Mohammad Naghavi wrote:
>
> @Sophistry: tried that, no changes.
>
> @AD7six: as stated also before, I have this route too, but nothing 
> changes: 
> Router::connect('/my-controller/', array('controller' => 'my_controller', 
> 'action'=>'index')); 
>

Some debugging perhaps then. One of the reasons I haven't read any of this 
thread, is the needless change in text colour. Would you mind writing in a 
color 
that I can read?

Google groups is .. starting to chaff.

Routes are order sensitive - so unless I missed where you stated your whole 
routes file before - your problem is likely the order you've defined the 
routes.

AD

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread Jeremy Burns | Class Outfit
Read. The. Manual.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 29 Aug 2012, at 15:24:26, Nareh Tarasyan  wrote:

> Thanks Marcus
> 
> but u know what I did here... see:
> 
> $this->set('rand', rand(1,$this->Word->find('count')));   
> 
>   $this->set('randword', $this->Word->findById());
> 
> I want ID= value of rand function, but don know how to write it.
> 
> -- 
> 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, send email to 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>  
>  

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: loadModel

2012-08-29 Thread Mancho
Ok, your IndexsController has view() method? If not exists you need create
the  view() method in the IndexsController and in this method set the vars.

--
Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
Thanks Marcus

but u know what I did here... see:

$this->set('rand', rand(1,$this->Word->find('count'))); 
$this->set('randword', $this->Word->findById());

I want ID= value of rand function, but don know how to write it.

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread Mohammad Naghavi
@Sophistry: tried that, no changes.

@AD7six: as stated also before, I have this route too, but nothing changes:
Router::connect('/my-controller/', array('controller' => 'my_controller',
'action'=>'index'));

I tried to remove default routes or to change the order but no success, I
think this is not a clean thing to do with cake!

MN



On Wed, Aug 29, 2012 at 3:56 PM, AD7six  wrote:

> 3rd time lucky perhaps.
>
> Router::connect('/my-controller/:action/*' <-
>
> This can only possibly generate a url of the form "/x/y/" or "/x/y/etc."
>
> Routes are not magic - they do what they say, and what your route says is
> "include the action in the url", so it does.
>
> AD
>
>
> On Tuesday, 28 August 2012 09:20:39 UTC+2, Mohammad Naghavi wrote:
>
>> @Salines: I read the page twice and didn't get any point about why having
>> this routing rule:
>> Router::connect('/my-**controlle**r/:action/*', array('controller' =>
>> 'my_controller'));
>> will result in producing urls with /index at the end, instead of simply
>> producing ones with nothing at the end.
>>
>> @lowpass: thanks anyway.
>>
>> Rgards,
>> Mohammad
>>
>>
>>
>> On Mon, Aug 27, 2012 at 8:21 PM, lowpass  wrote:
>>
>>> Sorry, I can't help. I never use the ":action" placeholder in routes
>>> so I'm not clear on what the issue could be. I prefer to specify all
>>> the possible routes. There shouldn't be any trouble with updating
>>> Cake's libs unless there is a big change in how routing is done.
>>>
>>> On Mon, Aug 27, 2012 at 9:47 AM, Mohammad Naghavi 
>>> wrote:
>>> > Hi again,
>>> > so I defined the routing approach but now I have a new problem. I have
>>> > defined this routing rule in app/Config/routes.php:
>>> > Router::connect('/my-**controller/:action/*', array('controller' =>
>>> > 'my_controller'));
>>> >
>>> > and in my view, I have a link like this:
>>> > Html->link('some title',
>>> > array('controller'=>'my_**controller', 'action'=>'index')) ?>
>>> >
>>> > the output is:
>>> > some title
>>> >
>>> > it has a new /index there! and I tried to remove it by adding this
>>> route:
>>> > Router::connect('/my-**controller/', array('controller' =>
>>> 'my_controller',
>>> > 'action'=>'index'));
>>> >
>>> > but it changes nothing!
>>> > and the worst is that pointing the browser to /mapp/my-controller/
>>> does not
>>> > go to index but shows the error page that says the
>>> My-controllerController
>>> > has to be created!
>>> > any Idea how to solve this new problem?
>>> >
>>> > Regards,
>>> > Mohammad
>>> >
>>> >
>>> > On Sun, Aug 26, 2012 at 12:00 PM, Mohammad Naghavi 
>>>
>>> > wrote:
>>> >>
>>> >> ok thanks to know. no it is not so bad, I just want to keep myself
>>> out of
>>> >> the way where updates to cake's core can immobilize my program in
>>> future.
>>> >>
>>> >> any way thanks again too much.
>>> >>
>>> >>
>>> >> On Sun, Aug 26, 2012 at 3:39 AM, lowpass  wrote:
>>> >>>
>>> >>> I understand now. No, you cannot customise this; the underscore is
>>> >>> hard-coded. See Inflector::humanize() and Inflector::underscore() (in
>>> >>> the Utility directory of the libs).
>>> >>>
>>> >>> But is it so bad to have to create routes?
>>> >>>
>>> >>> On Sat, Aug 25, 2012 at 11:14 AM, Mohammad Naghavi <
>>> moha...@gmail.com>
>>>
>>> >>> wrote:
>>> >>> > thanks for the response it works, however I have to define a
>>> routing
>>> >>> > rule
>>> >>> > per controller. but this is not a need in case I use underscores, I
>>> >>> > meant if
>>> >>> > there is a way to automate hyphens also like underscores?
>>> >>> >
>>> >>> > regards,
>>> >>> > Mohammad
>>> >>> > __**__
>>> >>> > PHP & ASP .Net 3.5 web developer
>>> >>> > Java & C# desktop developer
>>> >>> > www.mohamnag.com
>>> >>> >
>>> >>> >
>>> >>> >
>>> >>> > On Sat, Aug 25, 2012 at 12:19 PM, Salines 
>>>
>>> >>> > wrote:
>>> >>> >>
>>> >>> >>
>>> >>> >>> I mean for example the following has to generate a valid URL to
>>> >>> >>> MyController:
>>> >>> >>> $this->Html->link('some title',
>>> >>> >>> array('controller'=>'my-**controller'));
>>> >>> >>>
>>> >>> >>> but what I get is an error that says the My-controller has to be
>>> >>> >>> created.
>>> >>> >>> i.e. it does not recognize the existing MyController. can it be
>>> done
>>> >>> >>> in
>>> >>> >>> behaviour?
>>> >>> >>
>>> >>> >>
>>> >>> >> in the your view.ctp
>>> >>> >>
>>> >>> >>  $this->Html->link('some title', array('controller'=>'**
>>> MyController',
>>> >>> >> 'action'=>'view', $id);
>>> >>> >>
>>> >>> >> in the app/Config/routes.php
>>> >>> >>
>>> >>> >> Router::connect('/my-**controller/show-my-favorites/***',
>>> >>> >> array('controller'
>>> >>> >> => 'MyController', 'action' => 'view'));
>>> >>> >>
>>> >>> >>
>>> >>> >> Output links like
>>> >>> >>
>>> >>> >> some title
>>> >>> >>
>>> >>> >>
>>> >>> >>
>>> >>> >>
>>> >>> >> --
>>> >>> >> You received this message because you are subscribed to the Google
>>> >>> >> Groups
>>> >>> >> "CakePHP" group.
>>> >>> >> To post to this group, send email to ca

Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread AD7six
3rd time lucky perhaps.

Router::connect('/my-controller/:action/*' <-

This can only possibly generate a url of the form "/x/y/" or "/x/y/etc."

Routes are not magic - they do what they say, and what your route says is 
"include the action in the url", so it does.

AD

On Tuesday, 28 August 2012 09:20:39 UTC+2, Mohammad Naghavi wrote:
>
> @Salines: I read the page twice and didn't get any point about why having 
> this routing rule:
> Router::connect('/my-**controller/:action/*', array('controller' => 
> 'my_controller'));
> will result in producing urls with /index at the end, instead of simply 
> producing ones with nothing at the end.
>
> @lowpass: thanks anyway.
>
> Rgards,
> Mohammad
>
>
>
> On Mon, Aug 27, 2012 at 8:21 PM, lowpass 
> > wrote:
>
>> Sorry, I can't help. I never use the ":action" placeholder in routes
>> so I'm not clear on what the issue could be. I prefer to specify all
>> the possible routes. There shouldn't be any trouble with updating
>> Cake's libs unless there is a big change in how routing is done.
>>
>> On Mon, Aug 27, 2012 at 9:47 AM, Mohammad Naghavi 
>> > 
>> wrote:
>> > Hi again,
>> > so I defined the routing approach but now I have a new problem. I have
>> > defined this routing rule in app/Config/routes.php:
>> > Router::connect('/my-controller/:action/*', array('controller' =>
>> > 'my_controller'));
>> >
>> > and in my view, I have a link like this:
>> > Html->link('some title',
>> > array('controller'=>'my_controller', 'action'=>'index')) ?>
>> >
>> > the output is:
>> > some title
>> >
>> > it has a new /index there! and I tried to remove it by adding this 
>> route:
>> > Router::connect('/my-controller/', array('controller' => 
>> 'my_controller',
>> > 'action'=>'index'));
>> >
>> > but it changes nothing!
>> > and the worst is that pointing the browser to /mapp/my-controller/ does 
>> not
>> > go to index but shows the error page that says the 
>> My-controllerController
>> > has to be created!
>> > any Idea how to solve this new problem?
>> >
>> > Regards,
>> > Mohammad
>> >
>> >
>> > On Sun, Aug 26, 2012 at 12:00 PM, Mohammad Naghavi 
>> > 
>> >
>> > wrote:
>> >>
>> >> ok thanks to know. no it is not so bad, I just want to keep myself out 
>> of
>> >> the way where updates to cake's core can immobilize my program in 
>> future.
>> >>
>> >> any way thanks again too much.
>> >>
>> >>
>> >> On Sun, Aug 26, 2012 at 3:39 AM, lowpass 
>> >> > 
>> wrote:
>> >>>
>> >>> I understand now. No, you cannot customise this; the underscore is
>> >>> hard-coded. See Inflector::humanize() and Inflector::underscore() (in
>> >>> the Utility directory of the libs).
>> >>>
>> >>> But is it so bad to have to create routes?
>> >>>
>> >>> On Sat, Aug 25, 2012 at 11:14 AM, Mohammad Naghavi 
>> >>> 
>> >
>> >>> wrote:
>> >>> > thanks for the response it works, however I have to define a routing
>> >>> > rule
>> >>> > per controller. but this is not a need in case I use underscores, I
>> >>> > meant if
>> >>> > there is a way to automate hyphens also like underscores?
>> >>> >
>> >>> > regards,
>> >>> > Mohammad
>> >>> > 
>> >>> > PHP & ASP .Net 3.5 web developer
>> >>> > Java & C# desktop developer
>> >>> > www.mohamnag.com
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Sat, Aug 25, 2012 at 12:19 PM, Salines 
>> >>> > 
>> >
>> >>> > wrote:
>> >>> >>
>> >>> >>
>> >>> >>> I mean for example the following has to generate a valid URL to
>> >>> >>> MyController:
>> >>> >>> $this->Html->link('some title',
>> >>> >>> array('controller'=>'my-controller'));
>> >>> >>>
>> >>> >>> but what I get is an error that says the My-controller has to be
>> >>> >>> created.
>> >>> >>> i.e. it does not recognize the existing MyController. can it be 
>> done
>> >>> >>> in
>> >>> >>> behaviour?
>> >>> >>
>> >>> >>
>> >>> >> in the your view.ctp
>> >>> >>
>> >>> >>  $this->Html->link('some title', 
>> array('controller'=>'MyController',
>> >>> >> 'action'=>'view', $id);
>> >>> >>
>> >>> >> in the app/Config/routes.php
>> >>> >>
>> >>> >> Router::connect('/my-controller/show-my-favorites/*',
>> >>> >> array('controller'
>> >>> >> => 'MyController', 'action' => 'view'));
>> >>> >>
>> >>> >>
>> >>> >> Output links like
>> >>> >>
>> >>> >> some title
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> --
>> >>> >> You received this message because you are subscribed to the Google
>> >>> >> Groups
>> >>> >> "CakePHP" group.
>> >>> >> To post to this group, send email to 
>> >>> >> cake...@googlegroups.com
>> .
>> >>> >> To unsubscribe from this group, send email to
>> >>> >> cake-php+u...@googlegroups.com .
>> >>> >> Visit this group at 
>> http://groups.google.com/group/cake-php?hl=en-US.
>> >>> >>
>> >>> >>
>> >>> >
>> >>> >
>> >>> > --
>> >>> > You received this message because you are subscribed to the Google
>> >>> > Groups
>> >>> > "CakePHP" group.
>> >>> > To post to this group, send email to 
>> >>> > cake...@googlegroups.com
>> .
>> >>> > To unsubscribe from this group, send email

Re: CakePHP 2 and hyphens on the router

2012-08-29 Thread sophistry
@Mohammad I recall having a similar issue... it was because the controller 
name in the Router::connect() second parameter was not capitalized. try 
that?

On Tuesday, August 28, 2012 3:20:39 AM UTC-4, Mohammad Naghavi wrote:
>
> @Salines: I read the page twice and didn't get any point about why having 
> this routing rule:
> Router::connect('/my-**controller/:action/*', array('controller' => 
> 'my_controller'));
> will result in producing urls with /index at the end, instead of simply 
> producing ones with nothing at the end.
>
> @lowpass: thanks anyway.
>
> Rgards,
> Mohammad
>
>
>
> On Mon, Aug 27, 2012 at 8:21 PM, lowpass 
> > wrote:
>
>> Sorry, I can't help. I never use the ":action" placeholder in routes
>> so I'm not clear on what the issue could be. I prefer to specify all
>> the possible routes. There shouldn't be any trouble with updating
>> Cake's libs unless there is a big change in how routing is done.
>>
>> On Mon, Aug 27, 2012 at 9:47 AM, Mohammad Naghavi 
>> > 
>> wrote:
>> > Hi again,
>> > so I defined the routing approach but now I have a new problem. I have
>> > defined this routing rule in app/Config/routes.php:
>> > Router::connect('/my-controller/:action/*', array('controller' =>
>> > 'my_controller'));
>> >
>> > and in my view, I have a link like this:
>> > Html->link('some title',
>> > array('controller'=>'my_controller', 'action'=>'index')) ?>
>> >
>> > the output is:
>> > some title
>> >
>> > it has a new /index there! and I tried to remove it by adding this 
>> route:
>> > Router::connect('/my-controller/', array('controller' => 
>> 'my_controller',
>> > 'action'=>'index'));
>> >
>> > but it changes nothing!
>> > and the worst is that pointing the browser to /mapp/my-controller/ does 
>> not
>> > go to index but shows the error page that says the 
>> My-controllerController
>> > has to be created!
>> > any Idea how to solve this new problem?
>> >
>> > Regards,
>> > Mohammad
>> >
>> >
>> > On Sun, Aug 26, 2012 at 12:00 PM, Mohammad Naghavi 
>> > 
>> >
>> > wrote:
>> >>
>> >> ok thanks to know. no it is not so bad, I just want to keep myself out 
>> of
>> >> the way where updates to cake's core can immobilize my program in 
>> future.
>> >>
>> >> any way thanks again too much.
>> >>
>> >>
>> >> On Sun, Aug 26, 2012 at 3:39 AM, lowpass 
>> >> > 
>> wrote:
>> >>>
>> >>> I understand now. No, you cannot customise this; the underscore is
>> >>> hard-coded. See Inflector::humanize() and Inflector::underscore() (in
>> >>> the Utility directory of the libs).
>> >>>
>> >>> But is it so bad to have to create routes?
>> >>>
>> >>> On Sat, Aug 25, 2012 at 11:14 AM, Mohammad Naghavi 
>> >>> 
>> >
>> >>> wrote:
>> >>> > thanks for the response it works, however I have to define a routing
>> >>> > rule
>> >>> > per controller. but this is not a need in case I use underscores, I
>> >>> > meant if
>> >>> > there is a way to automate hyphens also like underscores?
>> >>> >
>> >>> > regards,
>> >>> > Mohammad
>> >>> > 
>> >>> > PHP & ASP .Net 3.5 web developer
>> >>> > Java & C# desktop developer
>> >>> > www.mohamnag.com
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Sat, Aug 25, 2012 at 12:19 PM, Salines 
>> >>> > 
>> >
>> >>> > wrote:
>> >>> >>
>> >>> >>
>> >>> >>> I mean for example the following has to generate a valid URL to
>> >>> >>> MyController:
>> >>> >>> $this->Html->link('some title',
>> >>> >>> array('controller'=>'my-controller'));
>> >>> >>>
>> >>> >>> but what I get is an error that says the My-controller has to be
>> >>> >>> created.
>> >>> >>> i.e. it does not recognize the existing MyController. can it be 
>> done
>> >>> >>> in
>> >>> >>> behaviour?
>> >>> >>
>> >>> >>
>> >>> >> in the your view.ctp
>> >>> >>
>> >>> >>  $this->Html->link('some title', 
>> array('controller'=>'MyController',
>> >>> >> 'action'=>'view', $id);
>> >>> >>
>> >>> >> in the app/Config/routes.php
>> >>> >>
>> >>> >> Router::connect('/my-controller/show-my-favorites/*',
>> >>> >> array('controller'
>> >>> >> => 'MyController', 'action' => 'view'));
>> >>> >>
>> >>> >>
>> >>> >> Output links like
>> >>> >>
>> >>> >> some title
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> --
>> >>> >> You received this message because you are subscribed to the Google
>> >>> >> Groups
>> >>> >> "CakePHP" group.
>> >>> >> To post to this group, send email to 
>> >>> >> cake...@googlegroups.com
>> .
>> >>> >> To unsubscribe from this group, send email to
>> >>> >> cake-php+u...@googlegroups.com .
>> >>> >> Visit this group at 
>> http://groups.google.com/group/cake-php?hl=en-US.
>> >>> >>
>> >>> >>
>> >>> >
>> >>> >
>> >>> > --
>> >>> > You received this message because you are subscribed to the Google
>> >>> > Groups
>> >>> > "CakePHP" group.
>> >>> > To post to this group, send email to 
>> >>> > cake...@googlegroups.com
>> .
>> >>> > To unsubscribe from this group, send email to
>> >>> > cake-php+u...@googlegroups.com .
>> >>> > Visit this group at 
>> http://groups.google.com/group/ca

Re: loadModel

2012-08-29 Thread Nareh Tarasyan

Thanks people.
I tried all, but none helps.That variables work in index.ctp, but not in 
view :/

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread AD7six
all hope is lost

On Wednesday, 29 August 2012 15:27:06 UTC+2, Nareh Tarasyan wrote:
>
> how can I use usual PHP functions in controller?
>
> for example i use 
> $rand=rand(1,$number)
>
> in View/index.ctp
>
> but don know how to use in controller?
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: PHP functions in controller

2012-08-29 Thread Marcus James
Hi,

You can use any PHP function in your controller just like you use it in
your normal PHP code.

It same in controller too :-

function index()
{
$rand=rand(1,$number);
}


Enjoy ,
Marcus

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
how can I use usual PHP functions in controller?

for example i use 
$rand=rand(1,$number)

in View/index.ctp

but don know how to use in controller?

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Nareh Tarasyan
Oh, yes, I did so than k u ver much :)

On Wednesday, August 29, 2012 2:52:17 PM UTC+4, Jeremy Burns wrote:
>
> $x (badly named variable) is an array. The first key will be 'Word', which 
> is itself an array where each key represents a field in the table; so, for 
> example, you could echo $x['Word']['id]; and that would print the id to 
> screen.
>
> On 29 Aug 2012, at 11:21, Shiv Shankar > 
> wrote:
>
> It would return an array. so use print_r($x); not echo.
>
> On Wednesday, August 29, 2012 3:38:04 PM UTC+5:30, Nareh Tarasyan wrote:
>>
>> Hey, ppl. help me.
>> I try this code:
>>
>>  IndexsController.php
>> $this->set('x', $this->Word->findByid(10));
>>
>> then 
>> view/Indexs/index.ctp
>> echo "word= ".$x;
>>
>> It echoes 
>>
>> word=Array;
>>
>>
>> What is the problem??? When I have loaded Word model in my 
>> IndexsController, and I have a record with id=10 in db table. :/
>>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> cake-php+u...@googlegroups.com .
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>  
>  
>
>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: cakephp 2.2.1 installation process in windows xp

2012-08-29 Thread Mancho
Depends of operating system. What operating system do you use?

--
Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: loadModel

2012-08-29 Thread Mancho
You never set to view file te $game and $word vars. Add to end of
index()method this:
$this->set('game', $game);
$this->set('word', $word);

I recommend you read the following:
http://book.cakephp.org/2.0/en/getting-started.html#blog-tutorial

--
Murgan, Alexis Germán
Desarrollador & Diseñador
Web: german.murgan.com.ar
Email: ger...@murgan.com.ar
MSN: ger...@murgan.com.ar
Móvil: +5493424663813

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




cakephp 2.2.1 installation process in windows xp

2012-08-29 Thread PMR
Hi,

   I was down loaded cakephp 2.2.1 from http://cakephp.org/downloads link, 
The thing is how to make the cakephp running environment, Can any one guide 
me step by step, Because of i am new to php i am java developer. Just i got 
some work in cakephp in my office that's why i need some support.

Reagrds
PMR

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Add Category in select in the Post form

2012-08-29 Thread thecosinus
Hi I've got a formulaire to cretaes Blog Post. In this form I ve a Category 
Select.

I'd like to add a category item in the category select using a popup or 
jquerry ui dialog but I really don't know how to start. How to post the 
category and how to refresh the select

I've you got any ideas

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: loadModel

2012-08-29 Thread Lucas Simon Rodrigues Magalhaes
And ...
$this->set(compact('games'));

Em quarta-feira, 29 de agosto de 2012 08h40min58s UTC-3, Lucas Simon 
Rodrigues Magalhaes escreveu:
>
> change this variable  $game = $this->Game->find('all'); 
> to
> $games =  = $this->Game->find('all');  
>
> in  IndexsController .
>
>
> Em quarta-feira, 29 de agosto de 2012 05h08min00s UTC-3, Nareh Tarasyan 
> escreveu:
>>
>> Hi people.
>> I'm a beginner in CakePHP.
>> And I need help. 
>>
>> I try to use loadModel.
>>
>> I have two models: games and words.
>>
>> In db have two tables: games(where I keep game difficulty levels) and 
>> words(where I keep words that I use in my game).
>>
>> Now I created IndexsController, where I load two models.
>> Here is how I do it:
>>
>> >
>> class IndexsController extends AppController {
>> public $helpers = array('Html', 'Form', 'Session');
>> public $components = array('Session');
>>
>>
>> public function index() {
>> $this->loadModel('Game');
>> $game = $this->Game->find('all');
>> $this->set('games', $this->Game->find('all'));
>>
>>
>> $this->loadModel('Word');
>> $word = $this->Word->find('all');
>> $this->set('words', $this->Word->find('all'));
>> }
>> }
>> ?>
>>
>> In View/Indexs I keep two files: index and view.
>> Here are they:
>>
>> index.ctp
>>
>> 
>>
>> 
>> 
>> Difficulty
>> 
>>
>> 
>>
>> 
>> 
>> 
>> Html->link($game['Game']['difficulty'], array('action' 
>> => 'view', $game['Game']['id'])); ?>
>> 
>>
>> 
>> 
>>
>> 
>> 
>>
>>
>> and view.ctp:
>> 
>> > .($game['Game']['difficulty']); ?>
>> 
>>
>>
>> Index.ctp works perfect, but in view.ctp it says:
>>
>> Undefined variable: game [APP\View\Indexs\view.ctp, line 9]
>>
>> What should I do???
>>
>> THanks everybody [image: smile.gif] 
>>
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: loadModel

2012-08-29 Thread Lucas Simon Rodrigues Magalhaes
change this variable  $game = $this->Game->find('all'); 
to
$games =  = $this->Game->find('all');  

in  IndexsController .


Em quarta-feira, 29 de agosto de 2012 05h08min00s UTC-3, Nareh Tarasyan 
escreveu:
>
> Hi people.
> I'm a beginner in CakePHP.
> And I need help. 
>
> I try to use loadModel.
>
> I have two models: games and words.
>
> In db have two tables: games(where I keep game difficulty levels) and 
> words(where I keep words that I use in my game).
>
> Now I created IndexsController, where I load two models.
> Here is how I do it:
>
> 
> class IndexsController extends AppController {
> public $helpers = array('Html', 'Form', 'Session');
> public $components = array('Session');
>
>
> public function index() {
> $this->loadModel('Game');
> $game = $this->Game->find('all');
> $this->set('games', $this->Game->find('all'));
>
>
> $this->loadModel('Word');
> $word = $this->Word->find('all');
> $this->set('words', $this->Word->find('all'));
> }
> }
> ?>
>
> In View/Indexs I keep two files: index and view.
> Here are they:
>
> index.ctp
>
> 
>
> 
> 
> Difficulty
> 
>
> 
>
> 
> 
> 
> Html->link($game['Game']['difficulty'], array('action' 
> => 'view', $game['Game']['id'])); ?>
> 
>
> 
> 
>
> 
> 
>
>
> and view.ctp:
> 
>  .($game['Game']['difficulty']); ?>
> 
>
>
> Index.ctp works perfect, but in view.ctp it says:
>
> Undefined variable: game [APP\View\Indexs\view.ctp, line 9]
>
> What should I do???
>
> THanks everybody [image: smile.gif] 
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Jeremy Burns : Class Outfit
$x (badly named variable) is an array. The first key will be 'Word', which is 
itself an array where each key represents a field in the table; so, for 
example, you could echo $x['Word']['id]; and that would print the id to screen.

On 29 Aug 2012, at 11:21, Shiv Shankar  wrote:

> It would return an array. so use print_r($x); not echo.
> 
> On Wednesday, August 29, 2012 3:38:04 PM UTC+5:30, Nareh Tarasyan wrote:
> Hey, ppl. help me.
> I try this code:
> 
>  IndexsController.php
> $this->set('x', $this->Word->findByid(10));
> 
> then 
> view/Indexs/index.ctp
> echo "word= ".$x;
> 
> It echoes 
> 
> word=Array;
> 
> 
> What is the problem??? When I have loaded Word model in my IndexsController, 
> and I have a record with id=10 in db table. :/
> 
> -- 
> 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, send email to 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>  
>  

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Shiv Shankar
It would return an array. so use print_r($x); not echo.

On Wednesday, August 29, 2012 3:38:04 PM UTC+5:30, Nareh Tarasyan wrote:
>
> Hey, ppl. help me.
> I try this code:
>
>  IndexsController.php
> $this->set('x', $this->Word->findByid(10));
>
> then 
> view/Indexs/index.ctp
> echo "word= ".$x;
>
> It echoes 
>
> word=Array;
>
>
> What is the problem??? When I have loaded Word model in my 
> IndexsController, and I have a record with id=10 in db table. :/
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Dr. Tarique Sani
Try debug($x);

T

On Wed, Aug 29, 2012 at 3:38 PM, Nareh Tarasyan  wrote:
> Hey, ppl. help me.
> I try this code:
>
>  IndexsController.php
> $this->set('x', $this->Word->findByid(10));
>

-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread Shiv Modi
I think it should be

$this->set('x', $this->Word->findById(10)); not $this->set('x',
$this->Word->findByid(10));

Shiv

On Wed, Aug 29, 2012 at 3:44 PM, AD7six  wrote:

> Have a look at what $x is.
>
> On Wednesday, 29 August 2012 12:08:04 UTC+2, Nareh Tarasyan wrote:
>>
>> Hey, ppl. help me.
>> I try this code:
>>
>>  IndexsController.php
>> $this->set('x', $this->Word->findByid(10));
>>
>> then
>> view/Indexs/index.ctp
>> echo "word= ".$x;
>>
>> It echoes
>>
>> word=Array;
>>
>>
>> What is the problem??? When I have loaded Word model in my
>> IndexsController, and I have a record with id=10 in db table. :/
>>
>  --
> 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, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>



-- 
Shiv Shankar

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: findById

2012-08-29 Thread AD7six
Have a look at what $x is.

On Wednesday, 29 August 2012 12:08:04 UTC+2, Nareh Tarasyan wrote:
>
> Hey, ppl. help me.
> I try this code:
>
>  IndexsController.php
> $this->set('x', $this->Word->findByid(10));
>
> then 
> view/Indexs/index.ctp
> echo "word= ".$x;
>
> It echoes 
>
> word=Array;
>
>
> What is the problem??? When I have loaded Word model in my 
> IndexsController, and I have a record with id=10 in db table. :/
>

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




findById

2012-08-29 Thread Nareh Tarasyan
Hey, ppl. help me.
I try this code:

 IndexsController.php
$this->set('x', $this->Word->findByid(10));

then 
view/Indexs/index.ctp
echo "word= ".$x;

It echoes 

word=Array;


What is the problem??? When I have loaded Word model in my 
IndexsController, and I have a record with id=10 in db table. :/

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




deleteAll cascade efficiency

2012-08-29 Thread Mohammad Naghavi
Hi there,

I have a question towards the one who know who Cake internally works. I'm
using MySql with InnoDB engine and therefore I have full foreignkey
support. I have also set all the on update and on delete actions in
database, so I can say I can totally rely on the DB now and can turn off
the cascade every where that I have a delete on my models. But is it
really necessary to go through them all and set the cascade to false for
efficiency? or it will not change any thing. the difference is if the Cake
removes the parent model before children the it does not rely on DB and is
inefficient.
this is unfortunately not documented in book:
http://book.cakephp.org/2.0/en/models/deleting-data.html

thanks for any tip in advance.

Regards,
MN

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




loadModel

2012-08-29 Thread Nareh Tarasyan
Hi people.
I'm a beginner in CakePHP.
And I need help. 

I try to use loadModel.

I have two models: games and words.

In db have two tables: games(where I keep game difficulty levels) and 
words(where I keep words that I use in my game).

Now I created IndexsController, where I load two models.
Here is how I do it:

loadModel('Game');
$game = $this->Game->find('all');
$this->set('games', $this->Game->find('all'));


$this->loadModel('Word');
$word = $this->Word->find('all');
$this->set('words', $this->Word->find('all'));
}
}
?>

In View/Indexs I keep two files: index and view.
Here are they:

index.ctp





Difficulty







Html->link($game['Game']['difficulty'], array('action' => 
'view', $game['Game']['id'])); ?>









and view.ctp:





Index.ctp works perfect, but in view.ctp it says:

Undefined variable: game [APP\View\Indexs\view.ctp, line 9]

What should I do???

THanks everybody [image: smile.gif] 

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Using multiple app folder in one server.

2012-08-29 Thread sdei
Hi

  My problem is that I'm using two cake folder in single application.

I hahe the structure as 

1>http_docs
 >app1
>portal
 -App2



What I want is:

1> When user type user/login applcation use portal/app2
2> When user type pages/home application use app1

How one can achieve it using .htaccess file?

-- 
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, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.