Dynamic Div styling question
So I am working on a helper which I want to dynamically set the div's size. I am using this: echo $this->Html->style(array('height' => '200px',)); But only getting this: height: 200px; Where as I want something like this: div#mycontainer{ height: 200px; } Does anyone know how to use the HTML->style function with div's & brackets? Thanks ~Michael -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: pagination problem, please help
thank you Ivan,... I have tried that by the book,... and probably missed something on its way in a first place,... well,... this is what I got now, and it's working, function category($id = null) { if($this->is_user()) { $this->set('user_obj', $user = $this->User->findById($this->user['id'])); } $filter = $this->params['pass']; $this->set('url_options', $filter); $category = $id; $cat_id = array_search($category, Configure::read('Blog.blog_category')); $this->set('category', $category); $this->paginate = array('Blog' => array('conditions' => array('Blog.categories' => $cat_id), 'limit' => 12, 'recursive' => 1)); $blogs = $this->paginate('Blog'); $this->set('blogs', $blogs); } On Sunday, November 18, 2012 1:52:17 PM UTC-8, ivnrmc wrote: > > i think this is your answer: > > function category($id = null){ > > if($this->is_user()) { > $this->set('user_obj', $user = > $this->User->findById($this->user['id'])); > } > > $category = $id; > $cat_id = array_search($category, > Configure::read('Blog.blog_category')); > > $this->paginate = array('Blog' => array('conditions' => > array('Blog.categories' => $cat_id), 'limit' => 12, 'recursive' => -1)); > $blogs = $this->paginate('Blog'); > > $this->set(compact('blogs', 'category')); > } > > > On Sun, Nov 18, 2012 at 9:05 PM, Chris >wrote: > >> hi guys,... I have a problem with pagination in a controller,... can >> someone help me please,... >> I'm getting an error: SQL Error: 1054: Unknown column 'limit' in 'where >> clause' >> >> how can I do this,...? >> >> function category($id = null) >> { >> if($this->is_user()) >> { >> $this->set('user_obj', $user = >> $this->User->findById($this->user['id'])); >> } >> >> $category = $id; >> >> $cat_id = array_search($category, >> Configure::read('Blog.blog_category')); >> >> $this->set('category', $category); >> >> $blogs = $this->Blog->find('all', array('conditions' => >> array('Blog.categories' => $cat_id))); >> >> $this->set('blogs', $blogs, $this->paginate('Blog', array('limit' >> => 12) )); >> >> thanks in advance, >> chris >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> 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. >> >> >> > > > > -- > *Ivan Rimac*** > mail: ivn...@gmail.com > *tel: +385 95 555 99 66* > *http://ivanrimac.com* > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Cake php
write the stored proceedure, use $this->model->query() to invoke it? On Mon, Nov 19, 2012 at 1:11 AM, John james wrote: > i want to use storedprocedure in cake php can any body tell me how to do > it ? > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: how to implement Smarty 3?
hi, for cool views can use this framework http://twitter.github.com/bootstrap/ and cakephp views. And check this to http://angularjs.org/ regards 2012/11/17 Martin Aguilar > For years I've been working on my own framework but now I wan't to migrate > to cakephp. > On my framework I used smarty for themes and to separate code from views. > I always find smarty clean, nice and with a very good performance. > Now I want to use it on cake but I found people saying that it has no > purpose. > And couldn't find a good article about implementing it. The only thing > that I found it's for cake 1.3 and smarty 2 and the article it's damage. > > http://bakery.cakephp.org/articles/tclineks/2006/10/27/how-to-use-smarty-with-cake-smartyviewOn > point 4, I see a lot of unreadable symbols. > > Any help on implementing smarty 3 on cake 2? > What it's your opinion on implementing smarty or any other template system? > > Thanks a lot > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Accessing fields of 'Events' model to compare user_id.
Hi all I am fairly new to CakePHP, I am trying to only allow those users who created an event to be able to edit or delete an event, so I am comparing the current user id, with the 'user_id' field of the event the current event (saved when a user creates an event). Any help would be appreciated thanks, my code(Andrew Perk) is as follows: public function isAuthorized($user) { $this->loadModel('User'); if ($user['role'] == 'admin') { return true; } if (in_array($this->action, array('edit', 'delete'))) { if ($user['id'] != $this->request->data['Event']['user_id']) { THIS IS THE LINE I FEEL IS WRONG - PLEASE ADVISE //echo debug($event['user_id']); //$this->Session->setFlash(__('You are not allowed to edit someones event')); return false; } } return true; } -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Tab index
This is a really old post, but just in case anyone else is searching and finds this (like I did)... Here's how you add *tabindex* with the Form Helper: $this->Form->input('foo', array(*'tabindex' => '1'*, [other options...])); $this->Form->input('bar', array(*'tabindex' => '2'*, [other options...])); On Thursday, September 16, 2010 1:14:23 PM UTC-5, Jeremy Burns wrote: > > I'm having a bad form day. My forms, built using the form helper and > using $this->Form->input have no sensible tab order. It seems that > inputs that result in a select list (for example, date fields) cannot > be tabbed into at all. I have tried setting the tabindex values, but > they do not control form flow. I have tested this in Firefox, Chrome > and Safari - all produce the same result. > > Any clues? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Cake php
i want to use storedprocedure in cake php can any body tell me how to do it ? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
how to implement Smarty 3?
For years I've been working on my own framework but now I wan't to migrate to cakephp. On my framework I used smarty for themes and to separate code from views. I always find smarty clean, nice and with a very good performance. Now I want to use it on cake but I found people saying that it has no purpose. And couldn't find a good article about implementing it. The only thing that I found it's for cake 1.3 and smarty 2 and the article it's damage. http://bakery.cakephp.org/articles/tclineks/2006/10/27/how-to-use-smarty-with-cake-smartyviewOn point 4, I see a lot of unreadable symbols. Any help on implementing smarty 3 on cake 2? What it's your opinion on implementing smarty or any other template system? Thanks a lot -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Calling MySQL5 Stored Procedures
I have to call a store procedure on my cakephp can anybpdy tell me how to do it ? On Tuesday, October 16, 2007 8:11:46 PM UTC+5, beverly.guillermo wrote: > > Hi all, > > Just thought I'd post my workaround based on some of the posts here > but I didn't see a consistent answer to the issue. My environment is > PHP 5.2.3, Apache 2.2.6, and MySQL 5.0.41-community. > > So, here's the problem, I have a stored procedure that I want to call > in Cake. When I try to run the $this->model->query("call > sp_mine(params)"); or $this->model->_call, I don't get anything back > and an mysql error occurs. > >Error 1312 - PROCEDURE <...> can't return a result set in the given > context: nothing returned > > To resolve this, I had to modify the connect call to the database in > dbo_mysql.php to include a client flag, specifically > CLIENT_MULTI_RESULTS or CLIENT_MULTI_STATEMENTS or 65536. But after > implementing this and calling my stored procedure I go another mysql > error: > > Error 2014 - Commands out of sync; you can't run this command now > > I get this for any query or execute that I attempt to call. And per a > post from blunt, I added this function > > function releaseDB() { > $db =& ConnectionManager::getDataSource($this->useDbConfig); > $db->disconnect(); > $db->connect(); > } > > to my model_php5.php. After every sp call, I call that method. > > > If anyone has a better resolution or if it's fixed in the current cake > version and I'm not doing something right, then let me know. :P > > Thanks, > Beverly > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: pagination problem, please help
i think this is your answer: function category($id = null){ if($this->is_user()) { $this->set('user_obj', $user = $this->User->findById($this->user['id'])); } $category = $id; $cat_id = array_search($category, Configure::read('Blog.blog_category')); $this->paginate = array('Blog' => array('conditions' => array('Blog.categories' => $cat_id), 'limit' => 12, 'recursive' => -1)); $blogs = $this->paginate('Blog'); $this->set(compact('blogs', 'category')); } On Sun, Nov 18, 2012 at 9:05 PM, Chris wrote: > hi guys,... I have a problem with pagination in a controller,... can > someone help me please,... > I'm getting an error: SQL Error: 1054: Unknown column 'limit' in 'where > clause' > > how can I do this,...? > > function category($id = null) > { > if($this->is_user()) > { > $this->set('user_obj', $user = > $this->User->findById($this->user['id'])); > } > > $category = $id; > > $cat_id = array_search($category, > Configure::read('Blog.blog_category')); > > $this->set('category', $category); > > $blogs = $this->Blog->find('all', array('conditions' => > array('Blog.categories' => $cat_id))); > > $this->set('blogs', $blogs, $this->paginate('Blog', array('limit' => > 12) )); > > thanks in advance, > chris > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > > > -- *Ivan Rimac*** mail: ivn...@gmail.com *tel: +385 95 555 99 66* *http://ivanrimac.com* -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
pagination problem, please help
hi guys,... I have a problem with pagination in a controller,... can someone help me please,... I'm getting an error: SQL Error: 1054: Unknown column 'limit' in 'where clause' how can I do this,...? function category($id = null) { if($this->is_user()) { $this->set('user_obj', $user = $this->User->findById($this->user['id'])); } $category = $id; $cat_id = array_search($category, Configure::read('Blog.blog_category')); $this->set('category', $category); $blogs = $this->Blog->find('all', array('conditions' => array('Blog.categories' => $cat_id))); $this->set('blogs', $blogs, $this->paginate('Blog', array('limit' => 12) )); thanks in advance, chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Session is not expiring when browser is closed
you really should not rely on that! this is a browser-specific setting and most people have their browser in "default" mode - meaning: the session will not expire anyway so there is no point in forcing this - IMO Am Sonntag, 18. November 2012 15:33:47 UTC+1 schrieb Chandru M: > > Thanks for the response. > > However the issue is only with the settings. > > Set "On Startup" setting to "Continue where I left off" > (chrome://chrome/settings/) > > But I am using the setting > > "On Startup" setting to "Open the New Tab page" > > I am not sure where the problem starts. > > I didn't get much support for this issue till now. > > > > > On Sunday, November 11, 2012 1:09:47 PM UTC+5:30, Andras Kende wrote: >> >> In Chrome thats a settings unfortunately not cakephp related: >> >> http://code.google.com/p/chromium/issues/detail?id=130291 >> >> not sure about Mozilla... >> >> Andras Kende >> http://www.kende.com >> >> >> On Nov 10, 2012, at 3:15 AM, Chandru M wrote: >> >> Hi all, >> >> I am struck with this peculiar problem for a long time. >> >> I have created a simple login page using the auth component. >> >> It seems the session is not getting expired when the browser is closed. >> >> The user gets automatically logged in when the browser is open again. >> >> I have used the suggestions given in the following URL. But still the >> problem persists. >> >> http://bakery.cakephp.org/articles/admad/2...g-to-your-needs >> >> I also tried by changing the Security.level property to High. >> >> I am using CAKephp 2.1.3 >> >> PHP 5.3.10 >> >> I am not sure where i am missing the configuration. >> >> I have also tried with the default settings >> >> I have tried this in the browsers Mozilla and Chrome. >> >> Any help? >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> 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. >> >> >> >> >> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Session is not expiring when browser is closed
Thanks for the response. However the issue is only with the settings. Set "On Startup" setting to "Continue where I left off" (chrome://chrome/settings/) But I am using the setting "On Startup" setting to "Open the New Tab page" I am not sure where the problem starts. I didn't get much support for this issue till now. On Sunday, November 11, 2012 1:09:47 PM UTC+5:30, Andras Kende wrote: > > In Chrome thats a settings unfortunately not cakephp related: > > http://code.google.com/p/chromium/issues/detail?id=130291 > > not sure about Mozilla... > > Andras Kende > http://www.kende.com > > > On Nov 10, 2012, at 3:15 AM, Chandru M > > wrote: > > Hi all, > > I am struck with this peculiar problem for a long time. > > I have created a simple login page using the auth component. > > It seems the session is not getting expired when the browser is closed. > > The user gets automatically logged in when the browser is open again. > > I have used the suggestions given in the following URL. But still the > problem persists. > > http://bakery.cakephp.org/articles/admad/2...g-to-your-needs > > I also tried by changing the Security.level property to High. > > I am using CAKephp 2.1.3 > > PHP 5.3.10 > > I am not sure where i am missing the configuration. > > I have also tried with the default settings > > I have tried this in the browsers Mozilla and Chrome. > > Any help? > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > > > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.
Re: Bad Request "URL not found" - after an JQuery change event
A. To debug, I'd insert the line: console.log(load + _this.find('option:selected').val()); just above your $.ajax() call. Then watch your Javascript console when running the page to see what URL is being submitted and try submitting it manually. - Rob On Friday, November 16, 2012 1:53:13 AM UTC-5, Benjamin Such wrote: > > Hey guys, I am really stuck with that problem. I have a JQuery Dialog > which contains a selectbox. When I change the option inside this selectbox, > another selectbox shows up with options generated from an .ajax() event. > Anyway... everything works fine, but when I submit the form CakePHP says: > 404 Bad Request - URL was not found, but it DOES EXISTS 100%. I tested it > several times to be sure, but another thing is: When submit the form > WITHOUT selecting any option from the first selectbox the form is submitted > correctly. I dont know what to post really but here is my Javascript: > > $('select[data-onchange=true]').live("change", function() { >> >> var _this = $(this); >> var element = $('select[data-onchange-trigger=' + >> _this.attr("id") + ']:first'); >> >> if (typeof element == "object") { >> if (_this.attr("data-onchange-load")) { >> var options = element.prop("options"); >> var load = _this.attr("data-onchange-load"); >> $.ajax({ >> dataType: "json", >> url: load + _this.find('option:selected').val(), >> beforeSend: function() { >> $('.ajax-loader').show(); >> element.find('option').remove(); >> element.parent().hide(); >> }, >> success: function(data) { >> $.each(data, function(index, _data) { >> if (typeof _data == "object") { >> $.each(_data, function(index, _data) { >> options[options.length] = new Option(_ >> data.name, _data.id); >> }); >> } >> }); >> element.parent().show(); >> }, >> complete: function() { >> $('.ajax-loader').hide(); >> } >> }); >> } >> } >> }); >> > > The error occurs only when I submit the form after I change the option on > the selectbox. > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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.