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 fram

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

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'][]

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: >

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

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->paginat

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 insid

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

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

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 unsubscri

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

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 echo

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'

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. T

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

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 chan

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

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. I

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 an

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 cak

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 h

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->

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')); >

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'))); > > $thi

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: +54934246

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

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 no

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 0

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 ha

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 ema

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

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

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@google

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

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 "C

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:

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 sup

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 --

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

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

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

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; >

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

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

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; > > >

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.

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 c

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. He

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 app