Re: Get Most Viewed Question

2010-08-31 Thread Hellbot
In controller $this-set('most_viewed', $this-Post-find('all', array('limit' = 10, 'order' = array('Post.views' = 'DESC'))); In view $most_view - your top 10 And don't forget add index to posts.views column in db 2010/9/1 Dave Maharaj m...@davemaharaj.com I am stumped on how to get top 10

Re: Get Most Viewed Question

2010-08-31 Thread Hellbot
Explanation: Sort your posts table by views column in descendent order and take only first ten. 2010/9/1 Hellbot g.hell...@gmail.com In controller $this-set('most_viewed', $this-Post-find('all', array('limit' = 10, 'order' = array('Post.views' = 'DESC'))); In view $most_view - your top 10

Re: How to allow all non-administrative route with Auth

2008-09-26 Thread Hellbot
Hi, i haven't checked this code, but as far as i remember function beforeFilter() { if (!isset($this-params[Configure::read('Routing.admin')])) { $this-Auth-allowedActions = array('*'); } On Sat, Sep 27, 2008 at 1:58 AM, ORCC [EMAIL PROTECTED] wrote: I'm using

Re: Routes + CAKE_ADMIN (admin routing)

2007-09-11 Thread Hellbot
http://groups.google.com/group/cake-php/browse_thread/thread/abec423ee6a9057a 2007/9/11, guigouz [EMAIL PROTECTED]: I'm writing a little catalog for a client, and setup Section and Product controllers with admin routing, so /admin/sections manages sections and /admin/products manages

Re: Strange routes/Router::url() behavior

2007-09-11 Thread Hellbot
Hi, now you need to declare what named arguments you want in BulletinsController:beforeFilter Router::connectNamed(array('bulletin_id')); 2007/9/11, [EMAIL PROTECTED] [EMAIL PROTECTED]: Thanks, I was not aware of the new explicit nature. On Sep 10, 5:15 pm, biesbjerg [EMAIL

Re: Quick admin routes question

2007-07-08 Thread Hellbot
Router::connect('/admin/', array(CAKE_ADMIN = true, 'controller' = 'photos', 'action' = 'index')); 2007/7/8, [EMAIL PROTECTED] [EMAIL PROTECTED]: I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes.

Re: adding extra fields when reading a model

2007-05-31 Thread Hellbot
Hello, quote from http://manual.cakephp.org/chapter/models afterFind Use this callback to modify results that have been returned from a find operation, or perform any other post-find logic. The parameter for this function is the returned results from the model's find operation, and the return

Re: Starting Session in CakePHP

2007-05-28 Thread Hellbot
Into the Controller::beforeFilter for example $this-Session-activate(); And into the Views before you need it $session-activate(); 2007/5/28, Przemek [EMAIL PROTECTED]: Hello, In my core.php file I set AUTO_SESSION to 'false' because I have to start session manually after 'require_once'

Re: Getting data from external applications / Constructing objects

2007-05-23 Thread Hellbot
Depends on version cakePHP for 1.1.x in ModelController: $this-ModelName-id = null; $this-ModelName-save(array('fieldName' = $fieldValue)); for 1.2.x in ModelController: $this-ModelName-create(array('fieldName' = $fieldValue)); $this-ModelName-save(); 2007/5/23, Dazweeja [EMAIL PROTECTED]:

Re: Why do I have to define this?

2007-05-18 Thread Hellbot
$telephone = $this-NameOfModel-read('tel',$id); my favorite :) 2007/5/18, Walker Hamilton [EMAIL PROTECTED]: I love this one: $this-NameOfModel-id = $id; $telephone = $this-NameOfModel-field('tel'); didn't know about it until you mentioned it.I guess I still don't completely

Re: Cascade Delete

2007-05-15 Thread Hellbot
as i known 'dependent' - must be a boolean (not a string) and you don't need to specify default parameter in model::delete function ?php class Inventory extends AppModel { var $name = 'Inventory'; var $validate = array( 'title' = VALID_NOT_EMPTY,

Acl in 1.2 question

2007-05-14 Thread Hellbot
Hello, everyone! I'm trying to build an Access Control Tree :-) looking like this: actions - - controller - - - - add - - another - - - - add and setup the following rights for users: supervisor has full access to actions user has full access to controller and no access to another. Here is

Re: how to deal with static pages ,can I routes url to a html page?

2007-05-09 Thread Hellbot
http://www.avatarfinancial.com/pages/cake/ Quote: I needed to create several pages that didn't use any models and contained static data inside the default layout. My first thought was to create a controller for these pages and define an action for each static page I needed. However, this

Re: Creating sub module / admin panel

2007-05-08 Thread Hellbot
http://cakephp.org/screencasts/view/5 On 8 май, 11:50, Jitu [EMAIL PROTECTED] wrote: How can we create sub module into cakephp. I want ot create an admin section for my website likewww.mywebsite.com/admin/. So, how can I configure a folder named admin into my main website.

Re: Creating sub module / admin panel

2007-05-08 Thread Hellbot
I'm not sure how this fits the ideology of CakePHP :), but you can create a directory /admin inside the application webroot and then just use .htaccess .htpasswd to password-protect the admin methods. 2007/5/8, Floyd [EMAIL PROTECTED]: Ok Hellbot but this screencasts only show how to use