0

I have a link that call a specific ajax action and in return it render the partial view on the screen that always update inside the div. Using this normally works but when i am using CHTML class to use static function like below

      <?php echo CHTML::linkButton("Like",array("href"=>"http://www.aa.com","id"=>"link-button-shrinked"))?> 

then ajax call does not work and gives strange error

      <h1>PHP Error [2]</h1>
      <p>YiiBase::include(CHTML.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory (C:\AppServ\www\abc.com\framework\YiiBase.php:418)</p>

my render view function is like this

$this->renderPartial('_character_actions',array("actionRecords"=>$actionRecords),false,true);

if i remove the CHTML function calls then everything works fine....kindly help me.

1 Answer 1

1

You got the class name wrong.

Just change CHTML to CHtml and you should be good.

Sign up to request clarification or add additional context in comments.

4 Comments

at first i thought you must be kidding because it works fine through the controller so i thought it doesnt matter having Chtml or CHTML. But changing text to CHtml really worked for the ajax ... Thanks a lot though i didn't get the logic behind this but it worked great..
You just the class name wrong, thats all no real logic :) .. edited the answer :D
right but even if the class is wrong it should never work on the first place without ajax call. I mean i was using the same view by renderpartial within another view and it worked fine so i dont think its related to class name. The issue came when i render through an ajax function. But anyhow still this logic i didnt understand :)
Class name is not wrong - PHP doesn't care about case of your vars or class names. But Yii's autoloading function make the difference, because will look for this class into the file that is named the same (on Linux at least, Windows make no difference between uppercase and lowercase chars in file/folder names)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.