Fatal Error: Call to a member function schema() on a non-object

2014-09-13 Thread Tobias Ibach


I have some trouble finding a solution for this..

Error: Call to a member function schema() on a non-objectFile: 
/Cake/Model/Model.phpLine: 3627

In my Database there are the tables *articles*,*hashtags* and the 
association *articles_hashtags* with the foreignkeys article_id and 
hashtag_id .. So i am trying to get the information what hashtags each 
article has.. 

*My Article Model*

class Article extends AppModel { 
public $hasAndBelongsToMany = array( 
'Hashtag' => array( 
'className' => 'Hashtag', 
'joinTable' => 'articles_hashtags', 
'foreignKey' => 'article_id', 
'associationForeignKey' => 'hashtag_id' 
) ); }

*Article Controller*

class ArticleController extends AppController { 
public $helpers = array("Html", "Form"); 
public function index() { 
$this->set("posts", $this->Article->find("all")); } }



Thanks for your 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


UserTools plugin for CakePHP 3.0

2014-09-13 Thread Florian Krämer
I've written a plugin for 3.0 that allows you to set up users pretty easy 
and quick for your application. The plugin was written in a way so that it 
allows you to configure virtually everything. If there is something missing 
from being configurable please let me know.

https://github.com/burzum/cakephp-user-tools

The plugin is still considered as *alpha* version and tagged as 
1.0.0-alpha. So issues might be still there and API changes are expected. 
However, in my local testing it worked fine an there are some unit tests 
present.

Just attach the UserTool component 

 
to your users controller and you can directly register and login, just go 
to //register and  //login. Password reset is 
available under  //request_password. Check the documentation 
 
for more details. The component is by default configured to map some 
actions to the component but you can disable the mapping of actions and 
implement your own login() method for example and still call 
$this->UserTool->login() within that method.

The User behavior 

 
is the very likely the more interesting part as it implements all the 
logic. Check it's default settings, there are plenty of configuration 
options you can change. Just make sure that your DB table matches what the 
plugin expects *or* configure the fieldmap of the behavior to reflect your 
tables fields. If you don't have an users table yet, the plugin comes with 
a DB migration for the official CakePHP 3.0 migrations plugin.

I don't have an active 3.0 project yet to work on and use this plugin. So 
I'm looking for any suggestions you have to improve the plugin. *Any 
feedback is welcome and appreciated!*

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398

2014-09-13 Thread HK
In cakephp 2 you could debug from controller before pages is rendered. You 
did get the error of headers already been sent but page rendered after. 
Now in cakephp3 if I debug in controller I get the same error but page 
stops rendering and produces a Fatal error: [RuntimeException] .

Why is that? Can I change that behavior?

On Thursday, February 14, 2013 9:37:03 PM UTC+2, Jeremy Burns wrote:
>
> Looks like you are debugging out some information before the page is 
> rendered. 
>
> Jeremy Burns 
> Class Outfit 
>
> http://www.classoutfit.com 
>
> On 14 Feb 2013, at 18:19:41, Mehrdad Dadkhah  > wrote: 
>
> > hi all 
> > 
> > what's the reason of this warning? 
> > 
> > 
> > Warning (2): Cannot modify header information - headers already sent 
> > by (output started at 
> > /home/hy4wtsgf/public_html/lib/Cake/Utility/Debugger.php:780) 
> > [CORE/Cake/Network/CakeResponse.php, line 398] 
> > Code Context 
> > 
> > setcookie - [internal], line ?? 
> > CakeResponse::_setCookies() - CORE/Cake/Network/CakeResponse.php, line 
> 398 
> > CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 375 
> > Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 168 
> > [main] - APP/webroot/index.php, line 92 
> > 
> > how can i resolve it? 
> > 
> > thanks in advance 
> > 
> > -- 
> > 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 unsubscribe from this group and stop receiving emails from it, send 
> an email to cake-php+u...@googlegroups.com . 
> > To post to this group, send email to cake...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/cake-php?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: A tool to design CakePHP schemas

2014-09-13 Thread HK


This is with latest firefox in debian testing and resolution 1920x1080





On Saturday, September 13, 2014 12:11:34 AM UTC+3, dariob wrote:
>
> Thank you HK!
> Please can you tell me your desktop resolution and browser's version?
> What doesn't work? Can you create a table?
>
> 2014-09-12 21:41 GMT+02:00 HK >:
>
>> very nice...
>>
>> but it doesn't work well on firefox (I tried it in my linux box).
>>
>>
>> On Friday, September 12, 2014 11:37:01 AM UTC+3, dariob wrote:
>>>
>>> Hi to all, I've developed a tool to design ER diagrams following CakePHP 
>>> conventions, would be great to have your feedback...
>>> http://cakeorm.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 a topic in the 
>> Google Groups "CakePHP" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/cake-php/6Oh7UKW20dU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Best practice to get menu array

2014-09-13 Thread Sam Clauw
I have 2 tables which hold pages information: "pages" and "cms_pages". Now 
I want to build a menu on every website page with the records within. 
What's the best practice for this?

Should I make a behavior that loads in the "pages" and "cms_pages" model? 
If yes, where (and how) should I make the call to that behavior? In the 
AppModel class?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.