Jump to content

cintolas

Members
  • Posts

    3
  • Joined

  • Last visited

cintolas's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks for the reply, but my question is can I do this without having to create the $var variable?Can I do this in entirely one line of code?
  2. Hi,Is there any way in php where I can take the result of the method and slice it directly without putting it into a variable firstFor example. I am working with Controllers in CakePHP.I make a method view($id).The following code works: function view($id){ $mypost = $this->Post->findById($id); $this->set('post', $mypost['Post']) ; } But doing this returns a parse error: Parse error: syntax error, unexpected '[ function view($id){ $this->set('post', ($this->Post->findById($id))['Post']) ; } It seems messy to create a temporary variable for something I can do inline in other languages.Is there a way to do what I am asking in php?
  3. Is there any way to link an XML file to an XSL file?I can plop an XSL stylesheet into an XML file no problem.However, I have no control over the XML file. I can only change the stylesheet. Right now I am resorting to making the transform using php and then displaying the result, but I would rather not have to use some server side technology (or client side javascript) if the browser can render it on the fly.I really find this to be a limitation of xsl
×
×
  • Create New...