Call to a member function element() on a non-object

2012-07-05 Thread LiveJin
I use the CakeGrid plugin,but I met some problems. *this is the error log:* 2012-07-05 15:13:26 Error: Fatal Error (1): Call to a member function element() on a non-object in [G:\htdocs\cakedemo\app\Plugin\CakeGrid\View\Helper\GridHelper.php, line 178] 2012-07-05 15:13:26 Error:

Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
If I have a feed of content each with a vote count. Any ideas on a basic sort mechanism to display this? Like Reddit, I'd like: * the content with the most votes to be toward the top * but I also don't want old content to remain at the top (e.g. if only sorting by votes, the feed won't change

Re: CakePHP 2.2.0 and 2.1.4 released

2012-07-05 Thread 42startups
Seamless pagination for custom find types Does that mean I don't have to make a hasOne custom bind for paginating a HABTM model? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help

CakePHP Ajax Pagination

2012-07-05 Thread Ronen Amiel
Hey everyone, Cake's ajax pagination produces code similar to the following: $(#link-1983047312).bind(click, function (event) {$.ajax({dataType:html, evalScripts:true, success:function (data, textStatus) {$(#tableWrap).html(data);}, url:\/companies\/index\/page:1}); Because Cake is

Re: ModelValidator fails on SaveAssociated in Plugin

2012-07-05 Thread tigr
It seems I found the problem, at least at first sight. It appears it is not sufficient to do a Find on the model, it is necessary to invoke either Set or Create on the model with the found (or newly created) record so that all the data gets properly populated. Then it works fine. On Wednesday,

Re: How can I add months to a date?

2012-07-05 Thread Mike Griffin
On Wed, Jul 4, 2012 at 4:30 PM, Steven Scaffidi ssca...@gmail.com wrote: This is what I have going on. $con_period = ceil($d['Option']['con_period']); $ebegin_date = strtotime(+$con_period months, strtotime($d['Project']['begin_date'])); $ebgin_date = date('Y-m-d', $ebegin_date); Is this

Re: Login problem

2012-07-05 Thread tigr
Ah, I am struggling to implement an authentication/authorization system myself now, so you have my sympathy :) So, your login works fine? Users get logged in? But they are not allowed access? Just out of curiosity why are you using isAuthorized at all? As for the problem at hand, it seems to

Re: Finding an user with a field from associated data ?

2012-07-05 Thread JonStark
Strangely, this works ace in the controller : public function countFollowing($id) { $following = $this-User-UsersUser-find('count', array( 'conditions' = array( 'follower_id' = $id ), )); return($following); } But then in the model, the code below returns find function on a non

Re: cakePhp showing menu or login form

2012-07-05 Thread Greg Skerman
you going to show us some code to help you with, or would you prefer us to write something for you? On Thu, Jul 5, 2012 at 6:07 AM, Peter Nassef peter.nas...@gmail.com wrote: Hello cakephp team i need to make website with admin panel but ican't do that i need to know who can make admin

Re: Missing Controller

2012-07-05 Thread Paul Willis
This sounds more like a server config error than a cake problem. Have you checked you config for https is the same as the working http one (apart from the port obviously) PW On 5 Jul 2012, at 04:52, Luke wrote: Hi everyone, I'm new to cake. I've installed Cake into a subdirectory

Re: Finding an user with a field from associated data ?

2012-07-05 Thread Stefanie
Hi everybody, I had almost the same problem some weeks ago. I read an article saying that HABTM is making some trouble from time to time and that it might be a better solution to split the HABTM relationship into a belongsTo and hasMany relationship. I changed my model User and UsersGroup and

Re: Getting strange console characters after updating to 2.2.0

2012-07-05 Thread bwelli...@gmail.com
I'm having the same issue with CakePHP 2.2.0-RC2 on Windows 7. Completely clean install. On Monday, July 2, 2012 4:44:57 PM UTC-7, José Lorenzo wrote: Those characters are color codes. Not sure why you are getting them on windows, but I think you should try a clean install of cakephp 2.2 to

Re: Getting strange console characters after updating to 2.2.0

2012-07-05 Thread rchavik
On Monday, 2 July 2012 13:57:44 UTC+7, Ronen Amiel wrote: Hey everyone. I updated my CakePHP version to 2.2.0 this morning. When I open up my console, I'm getting all these odd characters. Typing cake for instance give me the following: ←[36mWelcome to CakePHP v2.2.0 Console←[0m

Re: Cakephp with barcode

2012-07-05 Thread euromark
Well, you see there are quite a few ways to produce barcodes (see google for reference) those PHP libraries can easily be used from cakephp to display barcodes the other way around is more difficult. you would need hardware to actually read and process barcodes. a cellphone with a barcode reader

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread Greg Skerman
The basic idea would be to score the items based on how old they are. Simple division of votes by age in days would be a reasonable start. (10 votes and 1 days, score is 10, 10 votes and 2 days score is 5, etc etc) You will probably want to throw some form of weighting into the score though to

Re: Fresh Bake

2012-07-05 Thread lowpass
Yeah, that looks pretty weird. Did you update webroot/index.php, bootstrap.php, and core.php? Are the Cake libs in the default location or somewhere else? On Thu, Jul 5, 2012 at 8:31 PM, Advantage+ movepix...@gmail.com wrote: Using 2.1.3 and created DB ran the bake console and I end up with

Re: Fresh Bake

2012-07-05 Thread Dave Maharaj
I have Cake in a libs folder. But i just added v-host config so that seems to have corrected everything. Could have been wrong path on project install that screwed everything up but thanks for the fast response all the same. On Thu, Jul 5, 2012 at 10:41 PM, lowpass zijn.digi...@gmail.com wrote:

Re: Call to a member function element() on a non-object

2012-07-05 Thread LiveJin
Thanks for you answer me.And I try the method you provided.I have AppHelper.And I also change the __construct() in GridHelper.php ,but it seems not work. 在 2012年7月5日星期四UTC+8下午4时14分18秒,Superidea写道: Hello, View is no more part of ClassRegistry. Better approach could be as below for you

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
Cool thanks, I'll give that a go. Should I put that in the beforeRender() function? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To

3.0: a peek into CakePHP's future

2012-07-05 Thread José Lorenzo
Since its creation, more than 7 years ago, CakePHP has grown with a life of its own. Its main goal has always been to empower developers with tools that are both easy to learn and use, leverage great libraries requiring low documentation and low dependencies too. We've had several big

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread Greg Skerman
I'd do it in the query...as a virtual field - you should be able to get away with it as a pure expression. Probably much faster than getting everything then looping through the results. If you did end up having to do it programatically, a behavior might be the right place if you wish to reuse the

PHP the most wanted

2012-07-05 Thread Marsson C.
Hi again, What I've been seing is that many ecommerces (Magento, OpenCart, PrestaShop) are based on PHP. Just like Debian which many Linux distros are based on, PHP is the most used platform for tailoring your framework and ecommerces ?? Thanks! -- Our newest site for the community:

Create an admin console

2012-07-05 Thread David Lozzi
Hi There, I'm new to CakePHP, and so far I AM LOVING THIS! I was wondering if someone could point me to some docs on how I would create an admin console. I know how to create an user login and authentication, but what I am looking to do is domain.com/posts/ index and view would be public

How do I get some fields to display as Greek, some as Hebrew (most as English)?

2012-07-05 Thread Kevin Mitchell
I am new to CakePHP, having just learned how to bake a table to create Model, Controller, and View. One of the fields in my database is Hebrew (with diacritics) and one is Greek; the remainder of the fields are English. How do I get the Hebrew and Greek to show up correctly? As is, I just see

Re: Create an admin console

2012-07-05 Thread Dr. Tarique Sani
http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing Start here Tarique On Fri, Jul 6, 2012 at 8:19 AM, David Lozzi da...@lozzi.net wrote: Hi There, I'm new to CakePHP, and so far I AM LOVING THIS! I was wondering if someone could point me to some docs on how I would

Paginate with associated model conditions

2012-07-05 Thread Michael Gaiser
So I am having some issues getting Paginate to recognize its associated models when handling its conditions. Some events have a location_id, but others (like the feeding event) have their location id specified in the associated model. From the Events Index page I want to do a search for all events

Re: 3.0: a peek into CakePHP's future

2012-07-05 Thread Ilie
Why the removal of named parameters in the Router? They are quite useful to me and the Paginator uses them to keep track of page. What would be used instead? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site

A Peek of CakePHP 3

2012-07-05 Thread Marsson C.
In this URL http://bakery.cakephp.org/articles/lorenzo/2012/07/06/3_0_a_peek_into_cakephps_future It's said that Model layer rewrite: * Models to return objects from queries Currently, the only thing a query returns is an array ? The only way to perform queries on Models are read() and find(),

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
Thanks for the help! Wow, virtual fields are pretty cool. I ended up trying the old basic Hacker News algorithm with some extra boost for new posts. Not perfect, but looks like it will work to begin with. public $virtualFields = array( 'score' = '(Story.votes / (time_to_sec(timediff(NOW(),