I'm using the following Helper: http://pastebin.com/qBs2GvG4 in my CakePHP 2.0 app to show a gravatar for a user like so:
<?php $this->Gravatar->image($profile['User']['email'], array('default'=>'mm','size'=>48)); ?>
However it gives the error:
Fatal error: Call to a member function image() on a non-object in /Users/cameron/Sites/social/app/View/Helper/GravatarHelper.php on line 97
Any ideas what the problem is? This worked in my 1.3 app so wondering if something has changed between 1.3 and 2.0 that causes this issue? Thanks
Helpers have slightly different dependencies in 2.0, especially if they require other helpers.I actually made the commits to fix this one in the CakeDC utils plugin.
You can find an updated version of that helper here: https://github.com/CakeDC/utils/blob/2.0/View/Helper/GravatarHelper.php
Looks like the GravatarHelper has a dependency on the HtmlHelper. Is Html in your list of helpers in the controller?
Related
I am using SocalNick/ScnSocialAuth (https://github.com/SocalNick/ScnSocialAuth) library with Zend Framework 2 for my project. While I am trying to login using Facebook I am getting folowing error message.
Fatal error: Call to a member function getState() on a non-object in D:\php\htdocs\test\vendor\socalnick\scn-social-auth\src\ScnSocialAuth\Authentication\Adapter\HybridAuth.php on line 144
I am trying hard to find out the root of this problem, but could not find any solution so far.
Can any one say what can be the solution??
Thanks
From what info you've provided it seems that the Entity you have defined for Authentication has a member variable 'state' but no method to get it. (i.e. getState()).
Assumptions here include that you're using ZfcUser and you're probably overwriting the entity.
'user_entity_class' => '<mymodule>\Entity\User',
When using the described in the Google Contacts API example simple.php, and the Google API PHP Client from GitHub, version 1.0.4-beta, I get the following error:
Fatal error: Call to undefined method Google_IO_Curl::authenticatedRequest()
However, when I change this line...
$val = $client_svc_contacts->getIo()->authenticatedRequest($req);
...to...
$val = $client_svc_contacts->getAuth()->authenticatedRequest($req);
...then it starts working again.
I am using version 1.0.4-beta unmodified except for the addition of the following line at the top of Client.php:
set_include_path(str_replace('/Google','',dirname(__FILE__)));
I recognize that simple.php was written for version 0.6, not v1+, but is the example just out of date compared to the version on GitHub? Or is there something wrong with my implementation?
Found a migration guide that had the answer ...
A new home for authenticatedRequest
The authenticatedRequest method has been moved from the io classes to
the auth classes.
So it appears that replacing getIo() with getAuth() was the correct course of action.
I started experimenting with CakePHP version 2.x, I created a default.ctp layout file in View/Layouts inside of which I have codes like:
echo $this->fetch('css');
but I keep getting the following error:
Fatal error: Call to undefined method View::fetch() in C:\wamp\www\.......
I tried creating a block for this css in my view file like:
$this->start('css');
$this->Html->css('home_page', null, array('inline' => false));
$this->end();
But when I do this I get the following error:
Fatal error: Call to undefined method View::start() in C:\wamp\www\.......
Any help please?!!!
Thank you
View::fetch() is available since 2.1, what is your version?
I dont think you need fetch, start, end for including css, you can just use:
$this->Html->css(array('home_page.css'));
//OR
echo $this->fetch('css'); //from version 2.1
Ref: Css CakePHP
The book is a little ahead of the release atm! fetch() is from 2.1 code, which is still alpha.
Try generating a default layout using cake's bake tool and study that to see how 2.0 does it, and make sure do you don't follow bits of the book which say they are new in 2.1 until you are using the 2.1 codebase.
Hi i have uploaded a template on a website i have created using joomla and when i apply the template and visit my website i get the following error,
Fatal Error : call to a member function Fatal Error : call to a member function getCfg () on a non-object in /home/a7751589/public_html/templates/themza_j15_11/index.php on line 21.
the code on the index.php line 21 is as below.
$sliderVars['directionNav']=($this->params->get('sliderVars_directionNav')==='true' or $this->params->get('sliderVars_directionNav')==='false')?$this->params->get('sliderVars_directionNav'):'true';
please advise what i need to do to make this work,
Thank you
i recommend to checking compatibility of your theme with components...
check its http://forum.joomla.org/viewtopic.php?t=637126
Agree with GkDreamz - the "...J15..." part in your template name makes me think it's a 1.5 template that you're probably installing on a new 2.5 version.
When this happened to me, I noticed this in the PHP script:
global $mainframe;
Bear in mind that starting with Joomla 2.5, $mainframe is no longer using global, so it should be this:
$mainframe = & JFactory::getApplication();
I have been trying to implement an auth system for Codeigniter. I wanted to save time, though it hasn't succeeded so far.
The system I'm trying to implement is: http://codeigniter.com/wiki/auth/
Currently I have some forms working, but the registration form generates a fatal error:
PHP Fatal error: Call to undefined method CI_Loader::setdata() in /Applications/MAMP/htdocs/CI+Login/system/application/controllers/auth.php on line 159
Anyone has an idea what that is about? Anyone has got this system running?
thx.
EDIT:
The code that generates the error is:
if ($this->config->item('auth_use_security_code'))
$this->authlib->register_init();
$data['countries'] = $this->Usermodel->getCountries();
$this->load->setdata($data);
The problem is that load does not contain a method named setdata, has it in a previous version of CI or what can I make of this?
Try this:
$this->load->vars($data);
or remove this line and use the second parameter of the $this->load->view() function.
$this->load->view($this->config->item('auth_register_view'),$data);