> why you think CakePHP is a cool or productive framework to work with?
Cool:
1. community
2. lightweight, with very few dependencies
3. easy way to contribute to the sources and docs
Productive:
1. core code moving ahead (enhancements and adoptions of the new PHP
features) wisely, very few depr
https://github.com/slywalker/TwitterBootstrap
http://plugins.cakephp.org/packages?query=bootstrap
--
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.
> But then why does cleargroup() take a config as a parameter which defaults
> to "default"?
>
Cake needs to know which engine and prefix you want to use for cleargroup().
> Am I missing something?
>
You're probably missing ClearCache plugin - it allows to clear cache group
even if it is s
+1
I think this is what you want:
>
> http://api20.cakephp.org/class/cake-request#method-CakeRequestaddDetector
>
--
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 Cak
Just change last line of APP/webroot/index.php and call dispatcher with
your custom request class.
#APP/Lib/Network/AppRequest.php
App::uses('CakeRequest', 'Network');
class AppRequest extends CakeRequest {
...
}
#APP/webroot/index.php
...
App::uses('AppRequest', 'Network');
$Dispatcher->dispatc
Every render of layout/view/element creates (and destroys) one output
buffer, so for many iterations where you want to render some element, it is
better to create custom helper.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Quest
$path = '/UsersUser[follower_id=' . $logged_user_id . ']/id';
debug(Set::extract($path, $data));
--
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 questi
http://book.cakephp.org/2.0/en/core-libraries/behaviors/translate.html
--
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 unsubscribe from
Basically, you're talking about user profiles and caching, aren't you?
So associations User hasOne Profile, Profile belongsTo User, and your
visibility/etc attributes in profiles table.
Set up cache configuration for it
http://book.cakephp.org/2.0/en/core-libraries/caching.html (or use
'default
App::uses('AppModel', 'Model');
$Model = new AppModel(array(
'name' => 'Blog',
'table' => 'module_blog'
));
debug($Model->find('all'));
$Model->name = $Model->alias = 'Product';
$Model->setSource('module_product');
debug($Model->find('all'));
--
Our newest site for the community: Cake
Workflow is simple.
1. use I18n shell to generate .pot template from sources
http://book.cakephp.org/2.0/en/console-and-shells/i18n-shell.html
2. copy .pot file to .po files into lang-specific subdirectories and use
Poedit - tell it which .pot and .po files belongs together
3. translate msgstr i
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
if (App::import('Model', 'PluginName.ModelName')) {
$this->bindModel(array(
'hasMany' => array(
'PluginName.ModelName'
)
),
> the page is default has css menu and i want when i press about us to have
> the same default view with the samw css menu but different content.So that
> i dont have to write again inside the about page all the css menu...and
> so on .
>
In this case you want to extend existing layout
h
1. read this page
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html
2. be more specific
--
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
I'm not sure I understand your question.
If you want to set custom layout for some static page(s), then in
this/these page(s) just
$this->layout = 'custom';
You can change layout in controller's action AND in view as well.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.
One more thing about migrations - yes, CakePHP does have builtin shell for
database schema dump/restore
http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
but mentioned CakeDC migrations plugin is better.
And - welcome in CakePHP community! :-)
--
Our new
- Package management - for libs/vendors/plugins - git submodules
- Migrations - mainly for database schema/content changes, but also for
filesystem changes dependent on application version (migration does have
before() and after() callbacks) - https://github.com/CakeDC/migrations
- Automated De
public function beforeSave($options = array()) {
$this->set('foo', 'bar');
return parent::beforeSave($options);
}
--
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
$this->data[$this->alias]['foo'] = 'bar';
or
$this->set('foo', 'bar');
--
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 unsubscribe fr
I'm not sure what "best place" means in this case ;-) but IMHO proper place
is connect() method of datasource, so I would:
1. create new datasource class
#app/Model/Datasource/Database/MysqlNoConstraints.php
App::uses('Mysql', 'Model/Datasource/Database');
class MysqlNoConstraints extends Mysql
Add counterCache field to categories table and then use that field in
find('list') conditions.
http://book.cakephp.org/1.3/en/view/1033/counterCache-Cache-your-count
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site htt
Possibly sounds like work for InheritableBehavior from
https://github.com/CakeDC/utils and combination of "Single/Class Table
Inheritance" for your models.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.c
> when a new blog is created... I know it's probably wrong to do so, but it
> is easier for me to
You're right - it is wrong. Although it is technically possible, it would
cause many side effects you would have to solve in app code. Follow cake
conventions and cake will help you to do wh
In controller:
public $helpers = array(
'Html' => array('configFile' => 'tags')
);
Constructor of HtmlHelper will call $this->loadConfig('tags'):
http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#changing-the-tags-output-by-htmlhelper
--
Our newest site for the community: Cake
By the way, read whole chapter about model associations
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html
and follow cake conventions for primary/foreign keys - that means NOT
User.id == Blog.id BUT User.id == Blog.user_id.
--
Our newest site for the community: Ca
> $this->Blogpost->find(null, array(...));
>
Find type must be a string. Use $this->Blogpost->find('first', array(...))
or $this->Blogpost->read(array('Blogpost.blog_id'), $id);
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Que
__('Dummy text with string %s inside', 'something');
See sprintf() api for % type specifiers.
--
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 question
> In your example the Category model delete function should not be called
> unless that category is empty
>
Exactly. There should not be any "delete this category" links rendered in
views, if category is not "empty", or - they have to be "disabled" - this
is work for views/helpers.
But:
- th
> Can either of you, give me some best practices for exceptions processing?
> Maybe it is my self-taught PHP & CakePHP experiences but I have not a done
> a lot with exceptions. Is this efficient? Any good references to do some
> reading on this?
>
Learn from the best ones ;-)
http://mark
>
> I need to do more reading on Exceptions, but my case seems more like a
> flash message than throwing an exception.
>
Go back to reading ;-) because it is easier to throw 2 different custom
exceptions NotEmptyCategoryException (has some products) and
NotLeafCategoryException (has some subca
...or even better:
try {
if ($this->Category->delete($id)) {
$this->Session->setFlash('Category has been deleted');
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('Unknown error');
}
} catch (NotEmptyCategoryException $e) {
$t
> I need to do more reading on Exceptions, but my case seems more like a
> flash message than throwing an exception.
>
If you have your own custom exception NotEmptyCategoryException, you can
throw it from beforeDelete() and catch it in controller:
try {
$this->Category->delete($id);
} ca
Throw OutOfBoundsException somewhere and catch it from outside, or create
your own exception
http://book.cakephp.org/2.0/en/development/exceptions.html#creating-your-own-application-exceptions
Also, read better beforeDelete() callback for your example:
public function beforeDelete($cascade = tr
> i have created one file in controller with name testers_controller.php
>
...
> Create the class TestersController below in file: app\Controller
> \TestersController.php
>
Can you read?
Also, your controllers should extend AppController
--
Our newest site for the community: CakePHP Video
Sure, it is instance of AppModel using table payments.
--
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 unsubscribe from this group, sen
Cake creates instance of AppModel if it can not find proper model (default
by controller name or enlisted in $uses), it is obviously caused by wrong
filename.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://as
- enable debug to see what is wrong
- do not use php closing tag ?> if you don't want to be careful with
whitespace in source code
- do not use var $name if there is any chance you'll extend that
model/controller in future
--
Our newest site for the community: CakePHP Video Tutorials
http://tv
> I'm sure you are just saying what we are all thinking!
>
+1
--
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 unsubscribe from this
> I have newest version CakePHP 1.3
Current stable release is 2.1.2 - upgrade and then just
echo $this->Form->create(); //current url will be used
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakeph
-> animals
-> cats
-> dogs
That sounds like Class Table Inheritance (CTI) - see InheritableBehavior
from https://github.com/CakeDC/utils
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://
> is possible to get the Request object values from a behavior callback ?
>
No.
http://book.cakephp.org/2.0/en/core-libraries/events.html
--
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
public $uses = array();
public function beforefilter() {
parent::beforeFilter();
$this->CoolModel = ClassRegistry::init(array(
'class' => 'MyPlugin.MyPluginCoolModel',
'alias' => 'CoolModel',
));
}
Short version is
$this->CoolModel = ClassRegistry::init('MyPlugin.M
Read api/code of
Model::$id
Model::getID()
Model::exists()
--
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 unsubscribe from this group
> 1. Am I loading the plugin controller correctly?
>
No.
App::uses('PluginexampleAppController', 'Pluginexample.Controller');
2. Am I calling the plugin controllers function correctly?
> 3. I have tried to use the request action, it also gives me an error -
> is there a better way to call t
Watch, comment, and/or help with this ticket:
http://cakephp.lighthouseapp.com/projects/42648/tickets/2232-oracle-11g-datasource-for-cakephp-20
--
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
https://github.com/cakephp/datasources/blob/2.0/Model/Datasource/CouchdbSource.php
http://plugins.cakephp.org/packages?query=CouchDB
--
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 other
> For my catalog form I would like to use the same model, just need to
> validate also the fields: street, postcode, city and country.
>
If validation rule doesn't contain 'required' => true, then it is not
processed, if proper field (key) doesn't exist in model's data. It means -
just with
Let's say that your current validation rules in model Contact looks like:
public $validate = array(
'street' => array(
'allowEmpty' => true,
'rule' => array('minLength', 4),
'message' => 'At least %s characters required',
),
'postcode
Sounds like unfinished upgrade from 2.0 to 2.1
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-public
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org a
Move your method processFeedContent() to model Content and in loop:
$this->create($content);
if ($this->save()) {
...
}
--
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 thei
in OrganizationContoller:
public function beforeFilter() {
parent::beforeFilter();
array_unshift($this->Auth->authorize, 'Org');
}
--
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 hel
If user is not logged in, then in Event form:
echo $this->Form->input('Event.user_id', array('type' => 'hidden', 'value'
=> $user['User']['id']));
and in controller:
$this->Event->create($this->request->data);
if ($this->Event->save()) {
...
Do not forget to use SecurityComponent in AppControl
$this->Event->create($this->request->data);
$this->Event->set('user_id', $this->Auth->user('id'));
if ($this->Event->save()) {
...
--
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
Html form supports just GET and POST methods, thats why CakePHP (and
others) uses workaround with _method to fake PUT and DELETE. If you
want/need true PUT request from web browser, use XMLHttpRequest (ajax).
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
in your helper:
debug($this->_View->response->type());
--
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 unsubscribe from this group, se
The answer is CakePHP 3.0 (namespaces)
http://cakephp.lighthouseapp.com/projects/42648/development-roadmap
--
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 rel
Part of your issue is that .htaccess was changed in CakePHP 2.x
https://github.com/cakephp/cakephp/blob/master/app/webroot/.htaccess
http://book.cakephp.org/2.0/en/installation/advanced-installation.html#pretty-urls-on-nginx
--
Our newest site for the community: CakePHP Video Tutorials
http://tv
http:/google.com/search?q=cakephp+flow+chart
Some of diagrams are bit outdated (for 1.x) but basics are still the same.
Configure cache + sessions to not use filesystem storage and disable debug.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the
- rewrite this component as a helper
- use cached element
http://book.cakephp.org/2.0/en/views.html#caching-elements
- done
If you want to keep your code as a component, use beforeRender() callback
instead of beforeFilter(), example:
# app/Config/bootstrap.php
Cache::config('short', array(
For now (before they'll fix it) start browsing here
http://book.cakephp.org/2.0/en/index.html
--
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 question
Always call as first
$this->User->create(); //see the API
and then either
$fieldList = array(...);
$this->User->set($this->request->data);
$this->User->set('field', 'value');
$this->User->save(null, true, $fieldList);
or directly
$this->User->save($this->request->data, true, array(...));
Whic
In controller:
$response = $this->render('view_name');
$content = $response->body();
--
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 un
> I think Cake's continues to be hard to understand.
Good joke, if you want to amaze some teenage girl in candy store.
--
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 th
Also, check out these projects
http://plugins.cakephp.org/packages?query=acl
if you do not need wheel with some special shape.
--
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
wit
> 1. http://www.visuallizard.com/blog/2009/10/19/241
> 2.
> http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
> 3.
> http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/
>
1. 2009/10
2. 2010/05
3. 2010/06
Better use current stable CakePHP r
> $this->Auth->authorize = 'controllers';
>
$this->Auth->authorize = array('Controller');
--
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 questio
1. Do you store sessions in database? If yes, is it the same database as
the one with application data? If yes, why? And why not use other
(memcache) storage for sessions?
2. Stop blaming core code for slowness, until you'll be able to write short
example NOT using your own classes like Session
> Any one can help me with this ?
Not me, sorry. This is example, how should NOT look code of CakePHP
application, controller should be as slim as possible.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://as
Add an association User (with some auth level) hasMany User (registration
request) on foreign key reviewed_by (defaultnull) and save there id of
admin, showing/processing that particular request. Then you can test in
find conditions if that field is null, and you'll also keep history of who
app
RewriteBase /
--
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 unsubscribe from this group, send email to
cake-php+unsubscr...@googlegro
If you called Router::parseExtensions() in routes.php, you don't need to
call $this->RequestHandler->
setContent() manually - as long as requested URI does have .json extension
at the end or ajax request was called with proper dataType/accept request
header.
--
Our newest site for the communit
Don't use filesystem-based session handler in production, that's all.
http://book.cakephp.org/2.0/en/development/sessions.html
--
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
wit
I was talking about Model::_clearCache(), off course.
--
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 unsubscribe from this group, send
It makes sense (clear all cached views of any particular model by default).
Just override clearCache() in your model and implement your own logic in it.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakep
> I also download and copied the files dbo_sqlsrv.php and DboSource.php
>
> into my app/Model/Datasource folder but I'm getting the follow error:
>
1. file dbo_sqlsrv.php is for CakePHP 1.x, for 2.x you need this one
https://github.com/cakephp/datasources/blob/2.0/Model/Datasource/Database/Sqlsrv
http://plugins.cakephp.org/packages?query=oauth
--
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 unsubscribe from this group, send email
You're welcome.
If you have outdated CakeDC Migrations Plugin, upgrade it also:
https://github.com/CakeDC/migrations/issues/45#issuecomment-3747975
as well as calls of Dbosource::fullTableName() in your code.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Ch
...and watch ticket
http://cakephp.lighthouseapp.com/projects/42648/tickets/2709-modelschemaname-automatic-prefixing-with-the-modelschemaname-is-not-deactivable
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://a
For now, apply this patch:
https://github.com/ceeram/cakephp/compare/2.1...2.1-2709
--
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 uns
> I found no documentation about it.
What means "it"?
http://book.cakephp.org/2.0/en/console-and-shells.html
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questi
You'll have to configure that for _cake_core_ cache, see
http://book.cakephp.org/2.0/en/development/configuration.html#core-cache-configuration
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org an
This happens if you run console shell/task as root user with su or cron.
Either specify user www-data in crontab, or change cache configuration to
'mask' => 0644, or - don't use FileEngine in production.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check
82 matches
Mail list logo